Documentation ¶
Index ¶
- func Logger(ctx context.Context) *zap.Logger
- func Sync()
- func WithFields(ctx context.Context, fields ...zap.Field) context.Context
- func WithLogger(ctx context.Context, logger *zap.Logger) context.Context
- func WithName(ctx context.Context, name string) context.Context
- func WithNopLogger(ctx context.Context) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Logger ¶
Logger returns the logger that is associated with this context. If no logger has been set on the context explicitly, a default logger is returned.
func Sync ¶
func Sync()
Sync should be deferred at the beginning of a program's main function. It ensures that all logs are printed prior to program shutdown.
func WithFields ¶
WithFields adds the specified fields to the logger associated with the context.
func WithLogger ¶
WithLogger sets the specified logger in the context. Typically, you don't need this function and should prefer functions modifying the logger directly (e.g. `WithName`, `WithFields`, ...).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.