Documentation
¶
Index ¶
- Constants
- func Debug(a ...interface{})
- func Debugf(format string, a ...interface{})
- func Debugfn(fn logfunc)
- func Error(a ...interface{})
- func ErrorOnError(err error)
- func Errorf(format string, a ...interface{})
- func Errorfn(fn logfunc)
- func Fatal(a ...interface{})
- func FatalOnError(err error)
- func Fatalf(format string, a ...interface{})
- func Fatalfn(fn logfunc)
- func Info(a ...interface{})
- func Infof(format string, a ...interface{})
- func Infofn(fn logfunc)
- func SetConsoleLogLevel(level int)
- func SetConsolePrefix(prefix string)
- func SetStatFilePath(path string)
- func SetStatFilePrefix(prefix string)
- func Stat(a ...interface{})
- func Trace(a ...interface{})
- func Tracef(format string, a ...interface{})
- func Tracefn(fn logfunc)
- func Warn(a ...interface{})
- func WarnOnError(err error)
- func Warnf(format string, a ...interface{})
- func Warnfn(fn logfunc)
- type Logger
Constants ¶
View Source
const ( TRACE = iota DEBUG INFO WARN ERROR FATAL )
View Source
const ( Ldate = 1 << iota // the date: 20090123 Ltime // the time: 01:23:23 Lmicroseconds // microsecond resolution: 01:23:23.123123. assumes Ltime. Llevel // the log level: TRACE DEBUG INFO... Lfile // final file name element and line number: d.go:23. )
Variables ¶
This section is empty.
Functions ¶
func ErrorOnError ¶
func ErrorOnError(err error)
func FatalOnError ¶
func FatalOnError(err error)
func SetConsoleLogLevel ¶
func SetConsoleLogLevel(level int)
func SetConsolePrefix ¶
func SetConsolePrefix(prefix string)
func SetStatFilePath ¶
func SetStatFilePath(path string)
func SetStatFilePrefix ¶
func SetStatFilePrefix(prefix string)
func WarnOnError ¶
func WarnOnError(err error)
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewLogger ¶
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. The flag argument defines the logging properties.
func (*Logger) 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.
Click to show internal directories.
Click to hide internal directories.