package
1.1.4
Repository: https://github.com/abcxyz/pkg.git
Documentation: pkg.go.dev

# Functions

DefaultLogger creates a default logger.
FormatNames returns the list of all log format names.
FromContext returns the logger stored in the context.
GRPCStreamingInterceptor returns client-side a gRPC streaming interceptor that populates a logger with trace data in the context.
GRPCUnaryInterceptor returns a server-side gRPC unary interceptor that populates a logger with trace data in the context.
HTTPInterceptor returns an HTTP middleware that populates a logger with trace data onto the incoming and outgoing [http.Request] context.
LevelNames returns the list of all log level names.
LevelSlogValue returns the [slog.Value] representation of the level.
LevelString returns the string representation of the given level.
LookupFormat attempts to get the formatter that corresponds to the given name.
LookupLevel attempts to get the level that corresponds to the given name.
New creates a new logger in the specified format and writes to the provided writer at the provided level.
NewFromEnv is a convenience function for creating a logger that is configured from the environment.
NewLevelHandler creates a new handler that is capable of dynamically setting a level in a concurrency-safe way.
SetLevel adjusts the level on the provided logger.
TestLogger creates a new logger for use in tests.
WithLogger creates a new context with the provided logger attached.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

LevelHandler is a wrapper around a LevelHandler that gives us the ability to configure level at runtime without users needing to manage a separate LevelVar.

# Interfaces

LevelableHandler is an interface which defines a handler that is able to dynamically set its level.

# Type aliases

Format represents the logging format.