Documentation ¶
Overview ¶
package log defines strict logger types, which is referenced from https://dave.cheney.net/2015/11/05/lets-talk-about-logging.
Index ¶
- Constants
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Debugln(v ...interface{})
- func Flags() int
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Infoln(v ...interface{})
- func Level() int
- func Prefix() string
- func SetFlags(flag int)
- func SetLevel(level int)
- func SetOutput(w io.Writer)
- func SetPrefix(prefix string)
- 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) Flags() int
- func (l *Logger) Info(v ...interface{})
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) Infoln(v ...interface{})
- func (l *Logger) Level() int
- func (l *Logger) Prefix() string
- func (l *Logger) SetFlags(flag int)
- func (l *Logger) SetLevel(level int)
- func (l *Logger) SetOutput(w io.Writer)
- func (l *Logger) SetPrefix(prefix string)
- type SilentWriter
Constants ¶
View Source
const ( // These are specifies logging level. // InfoLevel outputs only calling Info*. // DebugLevel outputs all of outputting call, Info* and Debug*. InfoLevel = iota // output only Info* DebugLevel // output all, Info* and Debug* )
View Source
const ( // These flags are same as log package's. Ldate = log.Ldate // the date in the local time zone: 2009/01/23 Ltime = log.Ltime // the time in the local time zone: 01:23:23 Lmicroseconds = log.Lmicroseconds // microsecond resolution: 01:23:23.123123. assumes Ltime. Llongfile = log.Llongfile // full file name and line number: /a/b/c/d.go:23 Lshortfile = log.Lshortfile // final file name element and line number: d.go:23. overrides Llongfile LUTC = log.LUTC // if Ldate or Ltime is set, use UTC rather than the local time zone LstdFlags = log.LstdFlags // initial values for the standard logger )
View Source
const DebugPrefix = "DEBUG: "
DebugPrefix is 2nd prefix of outputting text when call Debug*. The most left prefix is which is used for SetPrefix or New(.., prefix, ...). So DebugPrefix places right by the most left prefix and left by the outputting text.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
type SilentWriter ¶
type SilentWriter struct{}
SilentWriter implements io.Writer. it writes no content and return no error so that any writing is ignored.
Click to show internal directories.
Click to hide internal directories.