Documentation ¶
Index ¶
- func Blue(content interface{}) string
- func Bold(content interface{}) string
- func Green(content interface{}) string
- func Magenta(content interface{}) string
- func Red(content interface{}) string
- func Reverse(content interface{}) string
- func Yellow(content interface{}) string
- type ConsoleLogger
- func (l *ConsoleLogger) Debugf(format string, args ...interface{})
- func (l *ConsoleLogger) Error(err error)
- func (l *ConsoleLogger) Errorf(format string, args ...interface{})
- func (l *ConsoleLogger) Infof(format string, args ...interface{})
- func (l *ConsoleLogger) IsEnabled(level Level) bool
- func (l *ConsoleLogger) SetLevel(level Level)
- func (l *ConsoleLogger) Warnf(format string, args ...interface{})
- func (l *ConsoleLogger) Write(p []byte) (int, error)
- type Level
- type Logger
- type NoopLogger
- func (l *NoopLogger) Debugf(format string, args ...interface{})
- func (l *NoopLogger) Error(err error)
- func (l *NoopLogger) Errorf(format string, args ...interface{})
- func (l *NoopLogger) Infof(format string, args ...interface{})
- func (l *NoopLogger) IsEnabled(level Level) bool
- func (l *NoopLogger) SetLevel(level Level)
- func (l *NoopLogger) Warnf(format string, args ...interface{})
- func (l *NoopLogger) Write(p []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConsoleLogger ¶
type ConsoleLogger struct {
// contains filtered or unexported fields
}
ConsoleLogger output messages to console
func NewConsoleLogger ¶
func NewConsoleLogger(tag string) *ConsoleLogger
NewConsoleLogger creates a new ConsoleLogger
func (*ConsoleLogger) Debugf ¶
func (l *ConsoleLogger) Debugf(format string, args ...interface{})
Debugf logs a DEBUG message
func (*ConsoleLogger) Errorf ¶
func (l *ConsoleLogger) Errorf(format string, args ...interface{})
Errorf logs a ERROR message
func (*ConsoleLogger) Infof ¶
func (l *ConsoleLogger) Infof(format string, args ...interface{})
Infof logs a INFO message
func (*ConsoleLogger) IsEnabled ¶ added in v0.10.0
func (l *ConsoleLogger) IsEnabled(level Level) bool
IsEnabled returns true if given level is enabled
func (*ConsoleLogger) SetLevel ¶
func (l *ConsoleLogger) SetLevel(level Level)
SetLevel increases/decreases current log level
func (*ConsoleLogger) Warnf ¶
func (l *ConsoleLogger) Warnf(format string, args ...interface{})
Warnf logs a WARN message
type Logger ¶
type Logger interface { SetLevel(level Level) Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Warnf(format string, args ...interface{}) Errorf(format string, args ...interface{}) Error(err error) IsEnabled(level Level) bool Write(p []byte) (int, error) }
Logger defines the logging interface.
type NoopLogger ¶ added in v0.10.0
type NoopLogger struct { }
NoopLogger doesn't log anything
func NewNoopLogger ¶ added in v0.10.0
func NewNoopLogger() *NoopLogger
NewNoopLogger creates a new NoopLogger
func (*NoopLogger) Debugf ¶ added in v0.10.0
func (l *NoopLogger) Debugf(format string, args ...interface{})
Debugf logs a DEBUG message
func (*NoopLogger) Error ¶ added in v0.10.0
func (l *NoopLogger) Error(err error)
Error logs a ERROR message
func (*NoopLogger) Errorf ¶ added in v0.10.0
func (l *NoopLogger) Errorf(format string, args ...interface{})
Errorf logs a ERROR message
func (*NoopLogger) Infof ¶ added in v0.10.0
func (l *NoopLogger) Infof(format string, args ...interface{})
Infof logs a INFO message
func (*NoopLogger) IsEnabled ¶ added in v0.10.0
func (l *NoopLogger) IsEnabled(level Level) bool
IsEnabled returns true if given level is enabled
func (*NoopLogger) SetLevel ¶ added in v0.10.0
func (l *NoopLogger) SetLevel(level Level)
SetLevel increases/decreases current log level
func (*NoopLogger) Warnf ¶ added in v0.10.0
func (l *NoopLogger) Warnf(format string, args ...interface{})
Warnf logs a WARN message
Click to show internal directories.
Click to hide internal directories.