Versions in this module Expand all Collapse all v1 v1.3.0 Jul 1, 2019 v1.2.0 Mar 17, 2018 Changes in this version + const ColorBlack + const ColorBlackBg + const ColorBlue + const ColorBlueBg + const ColorCyan + const ColorCyanBg + const ColorGreen + const ColorGreenBg + const ColorMagenta + const ColorMagentaBg + const ColorRed + const ColorRedBg + const ColorWhite + const ColorWhiteBg + const ColorYellow + const ColorYellowBg + var DefaultFormatter = MustStringFormatter("%{message}") + var ErrInvalidLogLevel = errors.New("logger: invalid log level") + var GlogFormatter = MustStringFormatter("%{level:.1s}%{time:0102 15:04:05.999999} %{pid} %{shortfile}] %{message}") + func ColorSeq(color color) string + func ColorSeqBold(color color) string + func ConvertColors(colors []int, bold bool) []string + func Redact(s string) string + func Reset() + func SetFormatter(f Formatter) + func SetLevel(level Level, module string) + type Backend interface + Close func() + Log func(int, *Record) + func NewBackendFormatter(b Backend, f Formatter) Backend + type ChannelMemoryBackend struct + func NewChannelMemoryBackend(size int) *ChannelMemoryBackend + func (b *ChannelMemoryBackend) Close() + func (b *ChannelMemoryBackend) Flush() + func (b *ChannelMemoryBackend) Head() *node + func (b *ChannelMemoryBackend) Log(calldepth int, rec *Record) + func (b *ChannelMemoryBackend) Start() + type FileBackend struct + Daily bool + Filename string + MaxDays int64 + MaxLines int + MaxSize int + Perm os.FileMode + Rotate bool + func NewDefaultFileBackend(filename string, asyncLen ...int) (*FileBackend, error) + func (w *FileBackend) Close() + func (w *FileBackend) Log(calldepth int, rec *Record) + type Formatter interface + Format func(calldepth int, colorful bool, r *Record, w io.Writer) error + func MustStringFormatter(format string) Formatter + func NewStringFormatter(format string) (Formatter, error) + 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) Close() + func (b *LogBackend) Log(calldepth int, rec *Record) + type Logger struct + ExtraCalldepth int + Module string + func NewLogger(module string) *Logger + func (l *Logger) Close() + 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) Print(args ...interface{}) + func (l *Logger) Printf(format string, args ...interface{}) + func (l *Logger) SetBackend(backend LeveledBackend) + func (l *Logger) Warn(args ...interface{}) + func (l *Logger) Warnf(format string, args ...interface{}) + 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) Close() + func (b *MemoryBackend) Head() *node + func (b *MemoryBackend) Log(calldepth int, rec *Record) + type Record struct + Args []interface{} + ID uint64 + Level Level + Module string + Time time.Time + func (r *Record) Formatted(calldepth int, colorful bool) string + func (r *Record) Message() string + type Redactor interface + Redacted func() interface{}