Documentation ¶
Index ¶
- func SetLevel(level Level)
- func SetLevelStr(level string)
- type Level
- type Logger
- func (l *Logger) CheckLevel(level Level) bool
- func (l *Logger) Debug(key int, format string, params ...interface{})
- func (l *Logger) Error(key int, err error)
- func (l *Logger) Format(format string, params ...interface{})
- func (l *Logger) Info(key int, format string, params ...interface{})
- func (l *Logger) IsDebug() bool
- func (l *Logger) Log(msg string)
- func (l *Logger) Newline()
- func (l *Logger) SetLevel(level Level)
- func (l *Logger) Warn(key int, format string, params ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetLevelStr ¶
func SetLevelStr(level string)
SetLevelStr will transform string to level and set
Types ¶
type Level ¶
Level is logging level
var ( // DEBUG is lowest level in logging DEBUG Level = Level{ Code: uint8(5), Name: "Debug", Short: "DBG", } // INFO is common message INFO Level = Level{ Code: uint8(3), Name: "Info", Short: "INF", } // WARN is a calm error message WARN Level = Level{ Code: uint8(2), Name: "Warn", Short: "WRN", } // ERROR is a critical error message ERROR Level = Level{ Code: uint8(1), Name: "Error", Short: "ERR", } // SILENT is a special level for mute all logging SILENT Level = Level{ Code: uint8(0), Name: "Silent", Short: "", } )
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is logging object
func (*Logger) CheckLevel ¶
CheckLevel is input level should be log or not
Click to show internal directories.
Click to hide internal directories.