logex

package
v0.3.30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldsFromCtx

func FieldsFromCtx(ctx context.Context) []zap.Field

FieldsFromCtx write context meta data

Types

type DefaultLogger added in v0.3.20

type DefaultLogger struct{}

DefaultLogger is a default logging struct.

func (DefaultLogger) Debug added in v0.3.20

func (l DefaultLogger) Debug(_ context.Context, msg string, args ...interface{})

Debug logs debug information. Parameters:

_ context.Context: Contextual information, not used in this implementation.
msg string: The message to be printed.
args ...interface{}: Variables to be formatted into the message.

func (DefaultLogger) Error added in v0.3.20

func (l DefaultLogger) Error(_ context.Context, msg string, args ...interface{})

Error logs error messages. Parameters are the same as the Debug function.

func (DefaultLogger) Info added in v0.3.20

func (l DefaultLogger) Info(_ context.Context, msg string, args ...interface{})

Info logs informational messages. Parameters are the same as the Debug function.

func (DefaultLogger) Warn added in v0.3.20

func (l DefaultLogger) Warn(_ context.Context, msg string, args ...interface{})

Warn logs warning messages. Parameters are the same as the Debug function.

type Logger added in v0.3.20

type Logger struct {
	// contains filtered or unexported fields
}

Logger defines a structure for the logger.

func (Logger) Debug added in v0.3.20

func (l Logger) Debug(ctx context.Context, msg string, args ...interface{})

Debug logs a message with context at the debug level. ctx: The context carrying additional log fields. msg: The main log message. args: Parameters used to format the msg.

func (Logger) Error added in v0.3.20

func (l Logger) Error(ctx context.Context, msg string, args ...interface{})

Error logs a message with context at the error level. Similar to Debug but records logs at the error level.

func (Logger) Info added in v0.3.20

func (l Logger) Info(ctx context.Context, msg string, args ...interface{})

Info logs a message with context at the info level. Similar to Debug but records logs at the info level.

func (Logger) Warn added in v0.3.20

func (l Logger) Warn(ctx context.Context, msg string, args ...interface{})

Warn logs a message with context at the warn level. Similar to Debug but records logs at the warn level.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL