Documentation
¶
Overview ¶
Implements a simple logger. Register writers (such as files, pipes, etc) using RegWriter and start logging. If no writers are registered Log writes everything to os.Stdout.
Index ¶
- func Debug(f string, v ...interface{})
- func Error(f string, e error, v ...interface{})
- func Info(f string, v ...interface{})
- func Log(f string, v ...interface{})
- func Warning(f string, v ...interface{})
- type Logger
- func (l *Logger) Debug(f string, v ...interface{})
- func (l *Logger) Error(f string, e error, v ...interface{}) error
- func (l *Logger) Info(f string, v ...interface{})
- func (l *Logger) Log(f string, v ...interface{})
- func (l *Logger) RegWriter(name string, w io.Writer)
- func (l *Logger) UnregWriter(name string)
- func (l *Logger) Warning(f string, v ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(f string, v ...interface{})
Format v to f and Log it. Logs if LogLevel >= 4.
Types ¶
type Logger ¶
type Logger struct {
LogLevel int // (0 .. 4) = (no logging, error, warning, info, debug)
// contains filtered or unexported fields
}
Logger
func (*Logger) Error ¶
Errorf logs then returns error e prefixed with v formatted to f. Logs if LogLevel >= 1.
func (*Logger) RegWriter ¶
Register a valid io.Writer by name. Caller is responsible for writer. Name is used solely if caller wishes to UnregWriter() later on.
func (*Logger) UnregWriter ¶
Unregisters a writer by name.
Click to show internal directories.
Click to hide internal directories.