Documentation ¶
Index ¶
- Variables
- type FdWriter
- type Logger
- func (l *Logger) Debug(v ...interface{})
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Error(v ...interface{})
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Fatal(v ...interface{})
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) Info(v ...interface{})
- func (l *Logger) Infof(format string, v ...interface{})
- 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 ...interface{})
- func (l *Logger) Tracef(format string, v ...interface{})
- func (l *Logger) Warn(v ...interface{})
- func (l *Logger) Warnf(format string, v ...interface{})
- func (l *Logger) WithColor() *Logger
- func (l *Logger) WithDebug() *Logger
- func (l *Logger) WithPlain() *Logger
- func (l *Logger) WithTimestamp() *Logger
- func (l *Logger) WithoutColor() *Logger
- func (l *Logger) WithoutDebug() *Logger
- func (l *Logger) WithoutPlain() *Logger
- func (l *Logger) WithoutTimestamp() *Logger
- type Prefix
Constants ¶
This section is empty.
Variables ¶
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) Debug ¶
func (l *Logger) Debug(v ...interface{})
Debug print debug message to output if debug output enabled
func (*Logger) Fatal ¶
func (l *Logger) Fatal(v ...interface{})
Fatal print fatal message to output and quit the application with status 1
func (*Logger) Fatalf ¶
Fatalf print formatted fatal message to output and quit the application with status 1
func (*Logger) Info ¶
func (l *Logger) Info(v ...interface{})
Info print informational message to output
func (*Logger) SetLogLevel ¶
func (*Logger) Trace ¶
func (l *Logger) Trace(v ...interface{})
Trace print trace message to output if debug output enabled
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) WithoutPlain ¶
WithoutPlain turn off plain output on the log
func (*Logger) WithoutTimestamp ¶
WithoutTimestamp turn off timestamp output on the log