Documentation ¶
Index ¶
- Constants
- func IsDebugEnable(logger Logger) bool
- func IsErrorEnable(logger Logger) bool
- func IsInfoEnable(logger Logger) bool
- func IsIntLevelEnable(expect, actual int) bool
- func IsLevelEnable(logger Logger, level int) bool
- func IsWarnEnable(logger Logger) bool
- func LevelToStr(level int) string
- func NewWriter(logger Logger, level int) io.Writer
- func StrToLevel(str string) int
- func Write(logger Logger, level int, format string, a ...interface{})
- type Chain
- type DefaultLogging
- type FieldLogger
- type IOLogger
- func (this *IOLogger) Debug(format string, a ...interface{})
- func (this *IOLogger) Error(format string, a ...interface{})
- func (this *IOLogger) Fatal(format string, a ...interface{})
- func (this *IOLogger) GetLevel() int
- func (this *IOLogger) Info(format string, a ...interface{})
- func (this *IOLogger) SetLevel(level int)
- func (this *IOLogger) Warn(format string, a ...interface{})
- func (this *IOLogger) Write(level int, format string, a ...interface{})
- type Logger
- type LoggerProvider
- type LoggingStruct
- type WritableLogger
Constants ¶
View Source
const ( LevelOff = -1 LevelNotSet = 0 LevelFatal = 1 LevelError = 3 LevelWarn = 4 LevelInfo = 6 LevelDebug = 7 LevelAll = 9 )
RFC5424 log message levels.
Variables ¶
This section is empty.
Functions ¶
func IsDebugEnable ¶
func IsErrorEnable ¶
func IsInfoEnable ¶
func IsLevelEnable ¶
func IsWarnEnable ¶
func LevelToStr ¶
func StrToLevel ¶
Types ¶
type DefaultLogging ¶
type DefaultLogging struct {
// contains filtered or unexported fields
}
func (*DefaultLogging) GetLogger ¶
func (this *DefaultLogging) GetLogger() Logger
获取当前对象上设置的 Logger 如果当前对象没有设置,则返回 Empty
func (*DefaultLogging) SetLogger ¶
func (this *DefaultLogging) SetLogger(logger Logger)
为当前对象设置 Logger 如果 logger 为 nil,则会将其置为 Empty
type FieldLogger ¶
type FieldLogger interface { Logger With(key string, val interface{}) FieldLogger WithMulti(map[string]interface{}) FieldLogger }
type Logger ¶
type Logger interface { GetLevel() int SetLevel(level int) Fatal(format string, a ...interface{}) Error(format string, a ...interface{}) Warn(format string, a ...interface{}) Info(format string, a ...interface{}) Debug(format string, a ...interface{}) }
var Empty Logger = &emptyLogger{}
type LoggerProvider ¶
type LoggingStruct ¶
type LoggingStruct struct {
// contains filtered or unexported fields
}
func (*LoggingStruct) GetLogger ¶
func (this *LoggingStruct) GetLogger() Logger
获取当前对象上设置的 Logger 如果当前对象没有设置,则返回 Empty
func (*LoggingStruct) SetLogger ¶
func (this *LoggingStruct) SetLogger(logger Logger)
为当前对象设置 Logger 如果 logger 为 nil,则会将其置为 Empty
type WritableLogger ¶
Click to show internal directories.
Click to hide internal directories.