Documentation ¶
Index ¶
- Variables
- type FdWriter
- type Logger
- func (l *Logger) Debug(v ...any)
- func (l *Logger) Debugf(format string, v ...any)
- func (l *Logger) Error(v ...any)
- func (l *Logger) Errorf(format string, v ...any)
- func (l *Logger) Fatal(v ...any)
- func (l *Logger) Fatalf(format string, v ...any)
- func (l *Logger) Info(v ...any)
- func (l *Logger) Infof(format string, v ...any)
- func (l *Logger) IsDebug() bool
- func (l *Logger) IsQuiet() bool
- func (l *Logger) NoQuiet() *Logger
- func (l *Logger) Output(depth int, prefix Prefix, data string) error
- func (l *Logger) Quiet() *Logger
- func (l *Logger) SetLogLevel(level log.LogLevel)
- func (l *Logger) SetOutput(w io.Writer)
- func (l *Logger) Trace(v ...any)
- func (l *Logger) Tracef(format string, v ...any)
- func (l *Logger) Warn(v ...any)
- func (l *Logger) Warnf(format string, v ...any)
- func (l *Logger) WithColor() *Logger
- func (l *Logger) WithDebug() *Logger
- func (l *Logger) WithTimestamp() *Logger
- func (l *Logger) WithoutColor() *Logger
- func (l *Logger) WithoutDebug() *Logger
- func (l *Logger) WithoutTimestamp() *Logger
- type Prefix
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // FatalPrefix show fatal prefix FatalPrefix = Prefix{ Plain: plainFatal, Color: colorful.Red(plainFatal), File: true, } // ErrorPrefix show error prefix ErrorPrefix = Prefix{ Plain: plainError, Color: colorful.Red(plainError), File: true, } // WarnPrefix show warn prefix WarnPrefix = Prefix{ Plain: plainWarn, Color: colorful.Orange(plainWarn), } // InfoPrefix show info prefix InfoPrefix = Prefix{ Plain: plainInfo, Color: colorful.Green(plainInfo), } // DebugPrefix show info prefix DebugPrefix = Prefix{ Plain: plainDebug, Color: colorful.Purple(plainDebug), File: true, } // TracePrefix show info prefix TracePrefix = Prefix{ Plain: plainTrace, Color: colorful.Cyan(plainTrace), } )
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger struct define the underlying storage for single logger
func New ¶
New returns new Logger instance with predefined writer output and automatically detect terminal coloring support
func (*Logger) Fatalf ¶
Fatalf print formatted fatal message to output and quit the application with status 1
func (*Logger) SetLogLevel ¶
func (*Logger) WithDebug ¶
WithDebug turn on debugging output on the log to reveal debug and trace level
func (*Logger) WithTimestamp ¶
WithTimestamp turn on timestamp output on the log
func (*Logger) WithoutColor ¶
WithoutColor explicitly turn off colorful features on the log
func (*Logger) WithoutDebug ¶
WithoutDebug turn off debugging output on the log
func (*Logger) WithoutTimestamp ¶
WithoutTimestamp turn off timestamp output on the log
Click to show internal directories.
Click to hide internal directories.