Documentation
¶
Index ¶
- type Level
- type Log
- func (l *Log) Debug(s string)
- func (l *Log) Debugf(format string, v ...interface{})
- func (l *Log) Error(s string)
- func (l *Log) Errorf(format string, v ...interface{})
- func (l *Log) Fatal(v ...interface{})
- func (l *Log) Fatalf(format string, v ...interface{})
- func (l *Log) Fatalln(v ...interface{})
- func (l *Log) Flags() int
- func (l *Log) Output(calldepth int, s string) error
- func (l *Log) Panic(v ...interface{})
- func (l *Log) Panicf(format string, v ...interface{})
- func (l *Log) Panicln(v ...interface{})
- func (l *Log) Prefix() string
- func (l *Log) Print(v ...interface{})
- func (l *Log) Printf(format string, v ...interface{})
- func (l *Log) Println(v ...interface{})
- func (l *Log) SetFlags(flag int)
- func (l *Log) SetOutput(w io.Writer)
- func (l *Log) SetPrefix(prefix string)
- func (l *Log) Writer() io.Writer
- type LogIface
- type LogLevelIface
- type LoggerIface
- type OutputIface
- type Router
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Log ¶
type Log struct { LogIface // contains filtered or unexported fields }
Log logging interface
func New ¶
New creates a new Logger. The out variable sets the destination to which log data will be written. The prefix appears at the beginning of each generated log line, or after the log header if the Lmsgprefix flag is provided. The flag argument defines the logging properties.
func (*Log) Fatal ¶
func (l *Log) Fatal(v ...interface{})
Fatal is equivalent to l.Print() followed by a call to exit.Handler.Exit(1).
func (*Log) Fatalln ¶
func (l *Log) Fatalln(v ...interface{})
Fatalln is equivalent to Println() followed by a call to exit.Handler.Exit(1).
func (*Log) Flags ¶
Flags returns the output flags for the logger. The flag bits are Ldate, Ltime, and so on.
func (*Log) Output ¶
Output writes the output for a logging event. The string s contains the text to print after the prefix specified by the flags of the Logger. A newline is appended if the last character of s is not already a newline. Calldepth is used to recover the PC and is provided for generality, although at the moment on all pre-defined paths it will be 2.
func (*Log) Panic ¶
func (l *Log) Panic(v ...interface{})
Panic is equivalent to l.Print() followed by a call to panic().
func (*Log) Panicln ¶
func (l *Log) Panicln(v ...interface{})
Panicln is equivalent to l.Println() followed by a call to panic().
func (*Log) Print ¶
func (l *Log) Print(v ...interface{})
Print calls l.Output to print to the logger. Arguments are handled in the manner of fmt.Print.
func (*Log) Printf ¶
Printf calls l.Output to print to the logger. Arguments are handled in the manner of fmt.Printf.
func (*Log) Println ¶
func (l *Log) Println(v ...interface{})
Println calls l.Output to print to the logger. Arguments are handled in the manner of fmt.Println.
func (*Log) SetFlags ¶
SetFlags sets the output flags for the logger. The flag bits are Ldate, Ltime, and so on.
type LogLevelIface ¶
type LogLevelIface interface { Error(string) Errorf(string, ...interface{}) Debug(string) Debugf(string, ...interface{}) }
LogLevelIface functions run when a level is set
type LoggerIface ¶
type LoggerIface interface { Fatal(...interface{}) Fatalf(string, ...interface{}) Fatalln(...interface{}) Flags() int Output(int, string) error Panic(...interface{}) Panicf(string, ...interface{}) Panicln(...interface{}) Prefix() string Print(...interface{}) Printf(string, ...interface{}) Println(...interface{}) SetFlags(int) SetOutput(io.Writer) SetPrefix(string) Writer() io.Writer }
LoggerIface A interface that matches log.Logger
type OutputIface ¶
type OutputIface interface { Debug(string) Debugf(string, ...interface{}) Error(string) Errorf(string, ...interface{}) Output(int, string) error Printf(string, ...interface{}) }
OutputIface router interface
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router route log messages to multiple streams
func (*Router) Output ¶
Output writes the output for a logging event. The string s contains the text to print after the prefix specified by the flags of the Logger. A newline is appended if the last character of s is not already a newline. Calldepth is used to recover the PC and is provided for generality, although at the moment on all pre-defined paths it will be 2.