Documentation ¶
Index ¶
- func Debugf(format string, args ...any)
- func Errorf(format string, args ...any)
- func Infof(format string, args ...any)
- func SetDisplayMode(m DisplayMode)
- func SetDisplayModeFromString(m string)
- func SetStderr(w io.Writer)
- func SetStdout(w io.Writer)
- func Verbose(format string, args ...any)
- func Warnf(format string, args ...any)
- type ContextKey
- type DisplayMode
- type Logger
- func (l *Logger) Debugf(format string, args ...any)
- func (l *Logger) Errorf(format string, args ...any)
- func (l *Logger) GetDisplayMode() DisplayMode
- func (l *Logger) Infof(format string, args ...any)
- 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 ...any)
- func (l *Logger) Warnf(format string, args ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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