package
0.0.0-20241001120344-791233ab31d1
Repository: https://github.com/wearemojo/mojo-public-go.git
Documentation: pkg.go.dev
# Functions
ConfigureTimeoutsAsErrors changes to default behaviour of logging timeouts as info, to log them as errors.
DetermineLevel returns a suggested logrus Level type for a given error.
Get retrieves the logrus Entry from the ContextLogger in a context and returns a new logrus Entry if none is found.
HandlePanic structurally logs a panic before optionally propagating.
NewContextLogger creates a new (mutable) ContextLogger instance from an (immutable) logrus Entry.
Set sets a persistent, mutable logger for the request context.
SetError adds or updates an error to the ContextLogger in a context.
SetField adds or updates a field to the ContextLogger in a context.
SetFields adds or updates fields to the ContextLogger in a context.
TimeoutsAsErrors determines whether ConfigureTimeoutsAsErrors was called on the context.
# Constants
HostKey is the log entry key for the hostname / container ID.
LevelKey is the log entry key for the log level.
MessageKey is the log entry key for a generic message.
ServiceKey is the log entry key for the name of the crpc service.
TimestampKey is the log entry key for the timestamp.
VersionKey is the log entry key for the current version of the codebase.
# Structs
Config allows services to configure the logging format, level and storage options for Logrus logging.
ContextLogger wraps logrus Entry to allow field mutation, which means the context itself can store a pointer to a ContextLogger, so it doesn't need replacing each time new fields are added to the logger.
# Type aliases
No description provided by the author