Documentation
¶
Index ¶
- Variables
- func GetErrorFormatter() string
- func NewLogger(out io.Writer, loggerType LoggerType) *logger
- func SetOnFatalFunc(onFatal func(format string, v ...interface{}))
- func SetOnPanicFunc(onPanic func(format string, v ...interface{}))
- func UpdateLogLevel(newLevel LogLevel) error
- type BasicLogger
- type LogLevel
- type LogLevelError
- type LoggerType
Constants ¶
This section is empty.
Variables ¶
View Source
var DebugLogger = NewLogger(ioutil.Discard, DebugLoggerType)
View Source
var ErrorLogger = NewLogger(os.Stderr, ErrorLoggerType)
View Source
var InfoLogger = NewLogger(os.Stderr, InfoLoggerType)
View Source
var LogLevels = []LogLevel{NormalLogLevel, DevelLogLevel, ErrorLogLevel}
View Source
var WarningLogger = NewLogger(os.Stderr, WarningLoggerType)
Functions ¶
func GetErrorFormatter ¶
func GetErrorFormatter() string
func NewLogger ¶
func NewLogger(out io.Writer, loggerType LoggerType) *logger
func SetOnFatalFunc ¶
func SetOnFatalFunc(onFatal func(format string, v ...interface{}))
func SetOnPanicFunc ¶
func SetOnPanicFunc(onPanic func(format string, v ...interface{}))
func UpdateLogLevel ¶
Types ¶
type BasicLogger ¶
type BasicLogger interface { Output(calldepth int, s string) error Writer() io.Writer SetOutput(w io.Writer) Flags() int SetFlags(flag int) Prefix() string SetPrefix(prefix string) Print(v ...interface{}) Printf(format string, v ...interface{}) Println(v ...interface{}) }
BasicLogger represents the logger without the panic and fatal methods
type LogLevelError ¶
type LogLevelError struct {
// contains filtered or unexported fields
}
func NewLogLevelError ¶
func NewLogLevelError() LogLevelError
func (LogLevelError) Error ¶
func (err LogLevelError) Error() string
type LoggerType ¶
type LoggerType string
const ( InfoLoggerType LoggerType = "INFO" WarningLoggerType LoggerType = "WARNING" ErrorLoggerType LoggerType = "ERROR" DebugLoggerType LoggerType = "DEBUG" )
Click to show internal directories.
Click to hide internal directories.