Documentation
¶
Index ¶
- func Debugf(format string, args ...interface{})
- func Errorf(format string, args ...interface{})
- func Infof(format string, args ...interface{})
- func SetDisplayMode(m DisplayMode)
- func SetDisplayModeFromString(m string)
- func SetStderr(w io.Writer)
- func SetStdout(w io.Writer)
- func Verbose(format string, args ...interface{})
- func Warnf(format string, args ...interface{})
- type ContextKey
- type DisplayMode
- type Logger
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) GetDisplayMode() DisplayMode
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) SetDisplayMode(m DisplayMode)
- func (l *Logger) SetDisplayModeFromString(m string)
- func (l *Logger) SetStderr(w io.Writer)
- func (l *Logger) SetStdout(w io.Writer)
- func (l *Logger) Verbose(format string, args ...interface{})
- func (l *Logger) Warnf(format string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf output the debug message to console
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf output the error message to console Deprecated: Use zap.L().Error() instead
func Infof ¶
func Infof(format string, args ...interface{})
Infof output the log message to console Deprecated: Use zap.L().Info() instead
func SetDisplayMode ¶
func SetDisplayMode(m DisplayMode)
SetDisplayMode changes the global output format of logger
func SetDisplayModeFromString ¶
func SetDisplayModeFromString(m string)
SetDisplayModeFromString changes the global output format of logger
Types ¶
type ContextKey ¶
type ContextKey string
ContextKey is key used to store values in context
const ContextKeyLogger ContextKey = "logger"
ContextKeyLogger is the key used for logger stored in context
type DisplayMode ¶
type DisplayMode int
DisplayMode control the output format
const ( DisplayModeDefault DisplayMode = iota // default is the interactive output DisplayModePlain // plain text DisplayModeJSON // JSON )
display modes
func GetDisplayMode ¶
func GetDisplayMode() DisplayMode
GetDisplayMode returns the current global output format
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a set of fuctions writing output to custom writters, but still using the global zap logger as our default config does not writes everything to a memory buffer. TODO: use also separate zap loggers
func (*Logger) GetDisplayMode ¶
func (l *Logger) GetDisplayMode() DisplayMode
GetDisplayMode returns the current output format
func (*Logger) SetDisplayMode ¶
func (l *Logger) SetDisplayMode(m DisplayMode)
SetDisplayMode changes the output format of logger
func (*Logger) SetDisplayModeFromString ¶
SetDisplayModeFromString changes the output format of logger