Documentation ¶
Overview ¶
Package log provides the core logger functions. Basically, this is a wrapper of log.Logger
Index ¶
Constants ¶
View Source
const LoggerContextKey = LoggerContext("LoggerContext")
LoggerContextKey is the key of context for get/set Logger
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContextAware ¶
type ContextAware interface { // Context returns the instance of context.Context Context() context.Context }
ContextAware is the interface for getting context.Context
type LevelLog ¶
LevelLog is the wrapper of built-in log.Logger
func GetLoggerFromContextOrDefault ¶
func GetLoggerFromContextOrDefault(aware ContextAware) (logger *LevelLog)
GetLoggerFromContextOrDefault returns a Logger instance from context, or a default instance if no Logger in the context
Click to show internal directories.
Click to hide internal directories.