zeus

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger(ctx context.Context) *zap.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

func WithFields(ctx context.Context, fields ...zap.Field) context.Context

WithFields adds the specified fields to the logger associated with the context.

func WithLogger

func WithLogger(ctx context.Context, logger *zap.Logger) context.Context

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`, ...).

func WithName

func WithName(ctx context.Context, name string) context.Context

WithName adds the specified name to the logger that is currently associated with the context.

func WithNopLogger

func WithNopLogger(ctx context.Context) context.Context

WithNopLogger sets a logger on the context which does not write anything. All calls to the logger functions are simply noops.

Types

This section is empty.

Jump to

Keyboard shortcuts

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