Documentation ¶
Index ¶
- Constants
- func Register(name string, log newLoggerFunc)
- type BeeLogger
- func (bl *BeeLogger) Alert(data map[string]interface{})
- func (bl *BeeLogger) Async(msgLen ...int64) *BeeLogger
- func (bl *BeeLogger) Close()
- func (bl *BeeLogger) Critical(data map[string]interface{})
- func (bl *BeeLogger) Debug(data map[string]interface{})
- func (bl *BeeLogger) DelLogger(adapterName string) error
- func (bl *BeeLogger) Emergency(data map[string]interface{})
- func (bl *BeeLogger) EnableFuncCallDepth(b bool)
- func (bl *BeeLogger) Error(data map[string]interface{})
- func (bl *BeeLogger) Flush()
- func (bl *BeeLogger) GetLevel() int
- func (bl *BeeLogger) GetLogFuncCallDepth() int
- func (bl *BeeLogger) Info(data map[string]interface{})
- func (bl *BeeLogger) Informational(data map[string]interface{})
- func (bl *BeeLogger) Notice(data map[string]interface{})
- func (bl *BeeLogger) Reset()
- func (bl *BeeLogger) SetLevel(l int)
- func (bl *BeeLogger) SetLogFuncCallDepth(d int)
- func (bl *BeeLogger) SetLogger(adapterName string, configs ...string) error
- func (bl *BeeLogger) SetPrefix(s string)
- func (bl *BeeLogger) Trace(data map[string]interface{})
- func (bl *BeeLogger) Warn(data map[string]interface{})
- func (bl *BeeLogger) Warning(data map[string]interface{})
- type Logger
Constants ¶
const ( LevelEmergency = iota LevelAlert LevelCritical LevelError LevelWarning LevelNotice LevelInformational LevelDebug )
RFC5424 log message levels.
const ( LevelInfo = LevelInformational LevelTrace = LevelDebug LevelWarn = LevelWarning )
Legacy log level constants to ensure backwards compatibility.
const ( AdapterConsole = "console" AdapterFile = "file" )
Name for adapter with beego official support
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BeeLogger ¶
type BeeLogger struct {
// contains filtered or unexported fields
}
BeeLogger is default logger in beego application. it can contain several providers and log message into all providers.
func NewLogger ¶
NewLogger returns a new BeeLogger. channelLen means the number of messages in chan(used where asynchronous is true). if the buffering chan is full, logger adapters write to file or other way.
func (*BeeLogger) Close ¶
func (bl *BeeLogger) Close()
Close close logger, flush all chan data and destroy all adapters in BeeLogger.
func (*BeeLogger) EnableFuncCallDepth ¶
EnableFuncCallDepth enable log funcCallDepth
func (*BeeLogger) GetLogFuncCallDepth ¶
GetLogFuncCallDepth return log funcCallDepth for wrapper
func (*BeeLogger) Informational ¶
Informational Log INFORMATIONAL level message.
func (*BeeLogger) Reset ¶
func (bl *BeeLogger) Reset()
Reset close all outputs, and set bl.outputs to nil
func (*BeeLogger) SetLevel ¶
SetLevel Set log message level. If message level (such as LevelDebug) is higher than logger level (such as LevelWarning), log providers will not even be sent the message.
func (*BeeLogger) SetLogFuncCallDepth ¶
SetLogFuncCallDepth set log funcCallDepth
func (*BeeLogger) SetLogger ¶
SetLogger provides a given logger adapter into BeeLogger with config string. config need to be correct JSON as string: {"interval":360}.
type Logger ¶
type Logger interface { Init(config string) error WriteMsg(when time.Time, msg map[string]interface{}, level int) error Destroy() Flush() }
Logger defines the behavior of a log provider.
func NewConsole ¶
func NewConsole() Logger
NewConsole create ConsoleWriter returning as LoggerInterface.