Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorHandler ¶
ErrorHandler wraps another handler and passes all records through unchanged except if the logged context contains a non-nil error value in its context. Then ErrorHandler will *increase* the log level to LvlError, unless it was already at LvlCrit.
This allows you to log the result of all functions for debugging and capture error conditions when in production with a single log line. Example:
reply, err := redisConn.Do("SET", "foo", "bar") logger.Debug("Wrote value to redis", "reply", reply, "err", err) if err != nil { return err }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.