Documentation ¶
Index ¶
- Constants
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Debugln(v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Errorln(v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Fatalln(v ...interface{})
- func Output(lv Level, calldepth int, s string) error
- func Panic(v ...interface{})
- func Panicf(format string, v ...interface{})
- func Panicln(v ...interface{})
- func Print(v ...interface{})
- func Printf(format string, v ...interface{})
- func Println(v ...interface{})
- func SetFlags(flag int)
- func SetMinLevel(lv Level)
- func SetOutput(w io.Writer)
- func SetPrefix(prefix string)
- func Trace(v ...interface{})
- func Tracef(format string, v ...interface{})
- func Traceln(v ...interface{})
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- func Warnln(v ...interface{})
- type Level
- type Logger
- func (l *Logger) Debug(v ...interface{})
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Debugln(v ...interface{})
- func (l *Logger) Error(v ...interface{})
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Errorln(v ...interface{})
- func (l *Logger) Fatal(v ...interface{})
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) Fatalln(v ...interface{})
- func (l *Logger) Output(lv Level, calldepth int, s string) error
- func (l *Logger) Panic(v ...interface{})
- func (l *Logger) Panicf(format string, v ...interface{})
- func (l *Logger) Panicln(v ...interface{})
- func (l *Logger) Print(v ...interface{})
- func (l *Logger) Printf(format string, v ...interface{})
- func (l *Logger) Println(v ...interface{})
- func (l *Logger) SetFlags(flag int)
- func (l *Logger) SetMinLevel(lv Level)
- func (l *Logger) SetOutput(w io.Writer)
- func (l *Logger) SetPrefix(prefix string)
- func (l *Logger) Trace(v ...interface{})
- func (l *Logger) Tracef(format string, v ...interface{})
- func (l *Logger) Traceln(v ...interface{})
- func (l *Logger) Warn(v ...interface{})
- func (l *Logger) Warnf(format string, v ...interface{})
- func (l *Logger) Warnln(v ...interface{})
- type OptFunc
Constants ¶
const ( Ldate = 1 << iota // the date in the local time zone: 2009/01/23 Ltime // the time in the local time zone: 01:23:23 Lmicroseconds // microsecond resolution: 01:23:23.123123. assumes Ltime. Llongfile // full file name and line number: /a/b/c/d.go:23 Lshortfile // final file name element and line number: d.go:23. overrides Llongfile LUTC // if Ldate or Ltime is set, use UTC rather than the local time zone Llevel // log level of message Ljson // JSON format LstdFlags = Ldate | Ltime | Llevel // initial values for the standard logger )
These flags define which text to prefix to each log entry generated by the Logger (compatible with log package).
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf calls std.Debugf() to print to the logger.
func Errorf ¶
func Errorf(format string, v ...interface{})
Errorf calls std.Errorf() to print to the logger.
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Fatalf calls std.Fatalf() to print to the logger.
func Panic ¶
func Panic(v ...interface{})
Panic is equivalent() to std.Output() followed by a call to panic().
func Panicf ¶
func Panicf(format string, v ...interface{})
Panicf is equivalent() to std.Output() followed by a call to panic().
func Panicln ¶
func Panicln(v ...interface{})
Panicln is equivalent() to std.Output() followed by a call to panic().
func Printf ¶
func Printf(format string, v ...interface{})
Printf calls std.Printf() to print to the logger.
func Tracef ¶
func Tracef(format string, v ...interface{})
Tracef calls std.Tracef() to print to the logger.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is logger class
func (*Logger) Debug ¶
func (l *Logger) Debug(v ...interface{})
Debug calls l.lprint() to print to the logger.
func (*Logger) Debugln ¶
func (l *Logger) Debugln(v ...interface{})
Debugln calls l.lprintln() to print to the logger.
func (*Logger) Error ¶
func (l *Logger) Error(v ...interface{})
Error calls l.lprint() to print to the logger.
func (*Logger) Errorln ¶
func (l *Logger) Errorln(v ...interface{})
Errorln calls l.lprintln() to print to the logger.
func (*Logger) Fatal ¶
func (l *Logger) Fatal(v ...interface{})
Fatal calls l.lprint() to print to the logger.
func (*Logger) Fatalln ¶
func (l *Logger) Fatalln(v ...interface{})
Fatalln calls l.lprintln() to print to the logger.
func (*Logger) Panic ¶
func (l *Logger) Panic(v ...interface{})
Panic is equivalent() to l.Output() followed by a call to panic().
func (*Logger) Panicln ¶
func (l *Logger) Panicln(v ...interface{})
Panicln is equivalent() to l.Output() followed by a call to panic().
func (*Logger) Print ¶
func (l *Logger) Print(v ...interface{})
Print calls l.lprint() to print to the logger.
func (*Logger) Println ¶
func (l *Logger) Println(v ...interface{})
Println calls l.lprintln() to print to the logger.
func (*Logger) SetMinLevel ¶
SetMinLevel sets the minimum level for the logger.
func (*Logger) Trace ¶
func (l *Logger) Trace(v ...interface{})
Trace calls l.lprint() to print to the logger.
func (*Logger) Traceln ¶
func (l *Logger) Traceln(v ...interface{})
Traceln calls l.lprintln() to print to the logger.
func (*Logger) Warn ¶
func (l *Logger) Warn(v ...interface{})
Warn calls l.lprint() to print to the logger.
type OptFunc ¶
type OptFunc func(*Logger)
OptFunc is self-referential function for functional options pattern
func WithMinLevel ¶ added in v0.2.0
WithMinLevel returns function for setting minimum level
func WithPrefix ¶ added in v0.2.0
WithPrefix returns function for setting prefix string
func WithWriter ¶ added in v0.2.0
WithWriter returns function for setting Writer