Documentation
¶
Index ¶
Constants ¶
View Source
const (
CorrelationIDParam string = "correlationId"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logging ¶
type Logging struct {
// contains filtered or unexported fields
}
Logging is a struct that contains the parameters for the logging.
func Fatal ¶
Fatal returns a new Logging instance configured for ERROR level log. After the log is printed, a panic is thrown.
func (*Logging) AddParam ¶
AddParam adds a key-value pair to the logging parameters. Example:
logging.Info(ctx).AddParam("userID", 123).Msg("User logged in")
func (*Logging) Err ¶
Err sets the error field in the Logging instance. When an error is added, the log will include a specific field for the error. error. Example:
err := errors.New("database connection failed")
logging.Error(ctx).Err(err).Msg("Database error")
Click to show internal directories.
Click to hide internal directories.