Documentation
¶
Index ¶
Constants ¶
View Source
const ( // FileLog output log to file FileLog = "file" // ConsoleLog output log to console ConsoleLog = "console" )
Variables ¶
This section is empty.
Functions ¶
func NewConsoleLogger ¶
NewConsoleLogger output to terminal
func NewFileLogger ¶
NewFileLogger output to file
Types ¶
type Logger ¶
type Logger interface {
// SetField sets a field on the logger's context. All future messages on this logger
// will have this field set.
SetField(name string, value interface{})
// Debug logs a debug message. If last parameter is a map[string]string, it's content
// is added as fields to the message.
Debug(v ...interface{})
// Debug logs a debug message with format. If last parameter is a map[string]string,
// it's content is added as fields to the message.
Debugf(format string, v ...interface{})
// Info logs a info message. If last parameter is a map[string]string, it's content
// is added as fields to the message.
Info(v ...interface{})
// Info logs a info message with format. If last parameter is a map[string]string,
// it's content is added as fields to the message.
Infof(format string, v ...interface{})
// Warn logs a warning message. If last parameter is a map[string]string, it's content
// is added as fields to the message.
Warn(v ...interface{})
// Warn logs a warning message with format. If last parameter is a map[string]string,
// it's content is added as fields to the message.
Warnf(format string, v ...interface{})
// Error logs an error message. If last parameter is a map[string]string, it's content
// is added as fields to the message.
Error(v ...interface{})
// Error logs an error message with format. If last parameter is a map[string]string,
// it's content is added as fields to the message.
Errorf(format string, v ...interface{})
}
Logger 系统logger接口
Click to show internal directories.
Click to hide internal directories.