Documentation ¶
Index ¶
Constants ¶
View Source
const ( LoggerKey = "logger" KindKey = "kind" ComponentKey = "component" )
Variables ¶
This section is empty.
Functions ¶
func RegisterLevelName ¶
RegisterLevelName register the name of one level. If the level is already exists, the function will overwrite it. If the name given is empty, it register nothing, or it deregister a level name.
Types ¶
type Field ¶
type Field struct { Key string Value interface{} }
Field is a marshaling operation used to add a key-value pair to a logger's context.
type Level ¶
type Level int8
A Level is a logging priority. Higher levels are more important.
const ( // DebugLevel logs are typically voluminous, and are usually disabled in // production. DebugLevel Level = iota - 1 // InfoLevel is the default logging priority. InfoLevel // WarnLevel logs are more important than Info, but don't need individual // human review. WarnLevel // ErrorLevel logs are high-priority. If an application is running smoothly, // it shouldn't generate any error-level logs. ErrorLevel // ClosedLevel logs output nothing. ClosedLevel = math.MaxInt8 )
type Logger ¶
type Logger interface { Print(v ...interface{}) Printf(format string, v ...interface{}) Println(v ...interface{}) LevelEnabled(level Level) bool With(field ...Field) Logger AtLevel(level Level) Logger }
Logger represents a logger with level, fields, ect.
func DefaultStd ¶
func DefaultStd() Logger
Click to show internal directories.
Click to hide internal directories.