Documentation
¶
Index ¶
- func FromContext(ctx context.Context) *zap.SugaredLogger
- func InitLogger(debug bool, jsonFormat bool)
- func LogDebug(ctx context.Context, msg string, keysAndValues ...interface{})
- func LogError(ctx context.Context, err error, msg string, keysAndValues ...interface{})
- func LogInfo(ctx context.Context, msg string, keysAndValues ...interface{})
- func Sync()
- func WithLogger(ctx context.Context) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
func FromContext(ctx context.Context) *zap.SugaredLogger
FromContext retrieves the logger from the context.
func InitLogger ¶
InitLogger initializes the logger with a specified log level and format (JSON or console).
func LogError ¶
LogError logs an error message with optional key-value pairs for structured logging.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.