Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColorfulLogger ¶
type ColorfulLogger struct { Red Logger Green Logger Yellow Logger Blue Logger Magenta Logger Cyan Logger White Logger }
ColorfulLogger is a collection of colored loggers.
func NewColorful ¶
func NewColorful(level Level) *ColorfulLogger
NewColorful creates a new colorful logger.
func (*ColorfulLogger) SetLevel ¶
func (l *ColorfulLogger) SetLevel(level Level)
SetLevel updates the logging level of all loggers.
type Level ¶
type Level int
Level is the logging verbosity level.
const ( // Trace shows logs in all levels. Trace Level = iota // Debug shows logs in Debug, Info, Warn, Error, and Fatal levels. Debug // Info shows logs in Info, Warn, Error, and Fatal levels. Info // Warn shows logs in Warn, Error, and Fatal levels. Warn // Error shows logs in Error and Fatal levels. Error // Fatal shows logs in Fatal level. Fatal // None does not show any logs. None )
type Logger ¶
type Logger interface { GetLevel() Level SetLevel(l Level) Tracef(format string, v ...interface{}) Debugf(format string, v ...interface{}) Infof(format string, v ...interface{}) Warnf(format string, v ...interface{}) Errorf(format string, v ...interface{}) Fatalf(format string, v ...interface{}) }
Logger is the interface for a simple logger.
Click to show internal directories.
Click to hide internal directories.