Versions in this module Expand all Collapse all v0 v0.2.3 Feb 27, 2015 v0.2.2 Feb 27, 2015 Changes in this version + var ErrInvalidLogLevel = errors.New("logger: invalid log level") + func MustStringFormatter(format string) *stringFormatter + func NewStringFormatter(format string) (*stringFormatter, error) + func Redact(s string) string + func Reset() + func SetFormatter(f Formatter) + func SetLevel(level Level, module string) + type Backend interface + Log func(Level, int, *Record) error + type ChannelMemoryBackend struct + func NewChannelMemoryBackend(size int) *ChannelMemoryBackend + func (b *ChannelMemoryBackend) Flush() + func (b *ChannelMemoryBackend) Head() *node + func (b *ChannelMemoryBackend) Log(level Level, calldepth int, rec *Record) error + func (b *ChannelMemoryBackend) Start() + func (b *ChannelMemoryBackend) Stop() + type Formatter interface + Format func(calldepth int, r *Record, w io.Writer) error + var DefaultFormatter Formatter = MustStringFormatter("%{message}") + var GlogFormatter Formatter = MustStringFormatter("%{level:.1s}%{time:0102 15:04:05.999999} %{pid} %{shortfile}] %{message}") + type Level int + const CRITICAL + const DEBUG + const ERROR + const INFO + const NOTICE + const WARNING + func GetLevel(module string) Level + func LogLevel(level string) (Level, error) + func (p Level) String() string + type Leveled interface + GetLevel func(string) Level + IsEnabledFor func(Level, string) bool + SetLevel func(Level, string) + type LeveledBackend interface + func AddModuleLevel(backend Backend) LeveledBackend + func MultiLogger(backends ...Backend) LeveledBackend + func SetBackend(backends ...Backend) LeveledBackend + type LogBackend struct + Color bool + Logger *log.Logger + func NewLogBackend(out io.Writer, prefix string, flag int) *LogBackend + func (b *LogBackend) Log(level Level, calldepth int, rec *Record) error + type Logger struct + Module string + func GetLogger(module string) (*Logger, error) + func MustGetLogger(module string) *Logger + func (l *Logger) Critical(args ...interface{}) + func (l *Logger) Criticalf(format string, args ...interface{}) + func (l *Logger) Debug(args ...interface{}) + func (l *Logger) Debugf(format string, args ...interface{}) + func (l *Logger) Error(args ...interface{}) + func (l *Logger) Errorf(format string, args ...interface{}) + func (l *Logger) Fatal(args ...interface{}) + func (l *Logger) Fatalf(format string, args ...interface{}) + func (l *Logger) Info(args ...interface{}) + func (l *Logger) Infof(format string, args ...interface{}) + func (l *Logger) IsEnabledFor(level Level) bool + func (l *Logger) Notice(args ...interface{}) + func (l *Logger) Noticef(format string, args ...interface{}) + func (l *Logger) Panic(args ...interface{}) + func (l *Logger) Panicf(format string, args ...interface{}) + func (l *Logger) SetBackend(backend LeveledBackend) + func (l *Logger) Warning(args ...interface{}) + func (l *Logger) Warningf(format string, args ...interface{}) + type MemoryBackend struct + func InitForTesting(level Level) *MemoryBackend + func NewMemoryBackend(size int) *MemoryBackend + func (b *MemoryBackend) Head() *node + func (b *MemoryBackend) Log(level Level, calldepth int, rec *Record) error + type Record struct + Id uint64 + Level Level + Module string + Time time.Time + func (r *Record) Formatted(calldepth int) string + func (r *Record) Message() string + type Redactor interface + Redacted func() interface{} + type SyslogBackend struct — darwin/amd64, js/wasm, linux/amd64 + Writer *syslog.Writer + func NewSyslogBackend(prefix string) (b *SyslogBackend, err error) + func NewSyslogBackendPriority(prefix string, priority syslog.Priority) (b *SyslogBackend, err error) + func (b *SyslogBackend) Log(level Level, calldepth int, rec *Record) error