Documentation
ΒΆ
Overview ΒΆ
Package logging sets up and configures logging.
Index ΒΆ
- func DefaultLogger() *zap.SugaredLogger
- func FromContext(ctx context.Context) *zap.SugaredLogger
- func NewLogger(level string, development bool) *zap.SugaredLogger
- func NewLoggerFromEnv() *zap.SugaredLogger
- func NewLoggerWithTeeCore(levelEnv string, development bool) *zap.SugaredLogger
- func WithLogger(ctx context.Context, logger *zap.SugaredLogger) context.Context
Constants ΒΆ
This section is empty.
Variables ΒΆ
This section is empty.
Functions ΒΆ
func DefaultLogger ΒΆ
func DefaultLogger() *zap.SugaredLogger
DefaultLogger returns the default logger for the package.
func FromContext ΒΆ
func FromContext(ctx context.Context) *zap.SugaredLogger
FromContext returns the logger stored in the context. If no such logger exists, a default logger is returned.
func NewLogger ΒΆ
func NewLogger(level string, development bool) *zap.SugaredLogger
NewLogger creates a new logger with the given configuration.
func NewLoggerFromEnv ΒΆ
func NewLoggerFromEnv() *zap.SugaredLogger
NewLoggerFromEnv creates a new logger from the environment. It consumes LOG_LEVEL for determining the level and LOG_MODE for determining the output parameters.
func NewLoggerWithTeeCore ΒΆ added in v0.7.0
func NewLoggerWithTeeCore(levelEnv string, development bool) *zap.SugaredLogger
NewLoggerWithTeeCore creates a new logger with a Tee zapcore(multiple).
func WithLogger ΒΆ
WithLogger creates a new context with the provided logger attached.
Types ΒΆ
This section is empty.
Click to show internal directories.
Click to hide internal directories.