Documentation ¶
Overview ¶
Package logger offers simple logging
Index ¶
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Panic(v ...interface{})
- func Panicf(format string, v ...interface{})
- func SetFlags(flag int)
- func SetLevel(lvl int)
- func SetOutput(w io.Writer)
- func Warning(v ...interface{})
- func Warningf(format string, v ...interface{})
- 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) Panic(v ...interface{})
- func (l *Logger) Panicf(format string, v ...interface{})
- func (l *Logger) SetFlags(flag int)
- func (l *Logger) SetLevel(lvl int)
- func (l *Logger) SetOutput(w io.Writer)
- func (l *Logger) Warning(v ...interface{})
- func (l *Logger) Warningf(format string, v ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(v ...interface{})
Debug uses the default logger and logs with the Debug severity. Arguments are handled in the manner of fmt.Print.
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf uses the default logger and logs with the Debug severity. Arguments are handled in the manner of fmt.Printf.
func Error ¶
func Error(v ...interface{})
Error uses the default logger and logs with the Error severity. Arguments are handled in the manner of fmt.Print.
func Errorf ¶
func Errorf(format string, v ...interface{})
Errorf uses the default logger and logs with the Error severity. Arguments are handled in the manner of fmt.Printf.
func Fatal ¶
func Fatal(v ...interface{})
Fatal uses the default logger, logs with the Fatal severity, and ends with os.Exit(1). Arguments are handled in the manner of fmt.Print.
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Fatalf uses the default logger, logs with the Fatal severity, and ends with os.Exit(1). Arguments are handled in the manner of fmt.Printf.
func Info ¶
func Info(v ...interface{})
Info uses the default logger and logs with the Info severity. Arguments are handled in the manner of fmt.Print.
func Infof ¶
func Infof(format string, v ...interface{})
Infof uses the default logger and logs with the Info severity. Arguments are handled in the manner of fmt.Printf.
func Panic ¶
func Panic(v ...interface{})
Panic uses the default logger and logs with the Error severity, and ends up with panic(). Arguments are handled in the manner of fmt.Print.
func Panicf ¶
func Panicf(format string, v ...interface{})
Panicf uses the default logger and logs with the Error severity, and ends up with panic(). Arguments are handled in the manner of fmt.Printf.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
A Logger represents an active logging object. Multiple loggers can be used simultaneously even if they are using the same writers.
func Init ¶
Init sets up logging and should be called before log functions, usually in the caller's main(). Default log functions can be called before Init(), but every severity will be logged. The first call to Init populates the default logger and returns the generated logger, subsequent calls to Init will only return the generated logger.
func (*Logger) Debug ¶
func (l *Logger) Debug(v ...interface{})
Debug logs with the Debug severity. Arguments are handled in the manner of fmt.Print.
func (*Logger) Debugf ¶
Debugf logs with the Debug severity. Arguments are handled in the manner of fmt.Printf.
func (*Logger) Error ¶
func (l *Logger) Error(v ...interface{})
Error logs with the Error severity. Arguments are handled in the manner of fmt.Print.
func (*Logger) Errorf ¶
Errorf logs with the Error severity. Arguments are handled in the manner of fmt.Printf.
func (*Logger) Fatal ¶
func (l *Logger) Fatal(v ...interface{})
Fatal logs with the Fatal severity, and ends with os.Exit(1). Arguments are handled in the manner of fmt.Print.
func (*Logger) Fatalf ¶
Fatalf logs with the Fatal severity, and ends with os.Exit(1). Arguments are handled in the manner of fmt.Printf.
func (*Logger) Info ¶
func (l *Logger) Info(v ...interface{})
Info logs with the Info severity. Arguments are handled in the manner of fmt.Print.
func (*Logger) Infof ¶
Infof logs with the Info severity. Arguments are handled in the manner of fmt.Printf.
func (*Logger) Panic ¶
func (l *Logger) Panic(v ...interface{})
Panic uses the default logger and logs with the Error severity, and ends up with panic(). Arguments are handled in the manner of fmt.Print.
func (*Logger) Panicf ¶
Panicf uses the default logger and logs with the Error severity, and ends up with panic(). Arguments are handled in the manner of fmt.Printf.