package
0.0.0-20241208190318-80fc79a84806
Repository: https://github.com/grevych/gobox.git
Documentation: pkg.go.dev
# Functions
Caller returns a log entry of the form F{"caller": "fileName:nn"}.
Debug emits a log at DEBUG level but only if an error or fatal happens within 2min of this event.
Error emits a log at ERROR level.
Fatal emits a log at FATAL level and exits.
Flush writes out all debug logs.
Info emits a log at INFO level.
No description provided by the author
Purge clears all debug logs without writing them out.
SetOutput can be used to set the output for the module Note: this function should not be used in production code outside of service startup.
Warn emits a log at WARN level.
With creates a logger that captures the marshaler arguments.
No description provided by the author
# Type aliases
F is a map of fields used for logging:
log.Info(ctx, "request started", log.F{"start_time": time.Now()})
When logging errors, use events.Err:
log.Error(ctx, "some failure", events.Err(err)).
Many aggregates marshaling of many items
This avoids having to build an append list and also simplifies code.
Marshaler is the interface to be implemented by items that can be logged.