Documentation ¶
Index ¶
- Variables
- func Crit(msg string, ctx ...interface{})
- func Debug(msg string, ctx ...interface{})
- func Error(msg string, ctx ...interface{})
- func Info(msg string, ctx ...interface{})
- func SetLogger(verbosity int, json bool)
- func TerminalFormatEx() log15.Format
- func Trace(msg string, ctx ...interface{})
- func Warn(msg string, ctx ...interface{})
- type GlogHandler
- type Handler
- type Lazy
- type Logger
- type Lvl
- type Record
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func TerminalFormatEx ¶
Types ¶
type GlogHandler ¶
type GlogHandler struct {
// contains filtered or unexported fields
}
GlogHandler is a log handler that mimics the filtering features of Google's glog logger: setting global log levels; overriding with callsite pattern matches; and requesting backtraces at certain positions.
func NewGlogHandler ¶
func NewGlogHandler(h Handler) *GlogHandler
NewGlogHandler creates a new log handler with filtering functionality similar to Google's glog logger. The returned handler implements Handler.
func (*GlogHandler) BacktraceAt ¶
func (h *GlogHandler) BacktraceAt(location string) error
BacktraceAt sets the glog backtrace location. When set to a file and line number holding a logging statement, a stack trace will be written to the Info log whenever execution hits that statement.
Unlike with Vmodule, the ".go" must be present.
func (*GlogHandler) Log ¶
func (h *GlogHandler) Log(r *Record) error
Log implements Handler.Log, filtering a log record through the global, local and backtrace filters, finally emitting it if either allow it through.
func (*GlogHandler) SetHandler ¶
func (h *GlogHandler) SetHandler(nh Handler)
SetHandler updates the handler to write records to the specified sub-handler.
func (*GlogHandler) Verbosity ¶
func (h *GlogHandler) Verbosity(level Lvl)
Verbosity sets the glog verbosity ceiling. The verbosity of individual packages and source files can be raised using Vmodule.
func (*GlogHandler) Vmodule ¶
func (h *GlogHandler) Vmodule(ruleset string) error
Vmodule sets the glog verbosity pattern.
The syntax of the argument is a comma-separated list of pattern=N, where the pattern is a literal file name or "glob" pattern matching and N is a V level.
For instance:
pattern="gopher.go=3" sets the V level to 3 in all Go files named "gopher.go" pattern="foo=3" sets V to 3 in all files of any packages whose import path ends in "foo" pattern="foo/*=3" sets V to 3 in all files of any packages whose import path contains "foo"