Documentation
¶
Overview ¶
Package logutil provides utility functions for logging.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogLevelForError ¶
LogLevelForError determines the log level for an error. It returns ErrorLevel by default, or a custom level if the error implements LogLevelSpecifier.
func LogLevelFuncForError ¶
func LogLevelFuncForError(err error, logger log.Logger) func(ctx context.Context, message any, fields ...log.Field)
LogLevelFuncForError returns the appropriate logging function for an error. It uses LogLevelForError to determine the log level and returns the corresponding Logger method.
Types ¶
type LogLevelSpecifier ¶
LogLevelSpecifier is an interface for errors that specify their log level.
Click to show internal directories.
Click to hide internal directories.