Versions in this module Expand all Collapse all v0 v0.1.7 Jan 2, 2022 Changes in this version + const DefaultTemplate + const NamedTemplate + var AllLevels = Levels + var ColorTheme = map[Level]color.Color + var DangerLevels = Levels + var DefaultChannelName = "application" + var DefaultFields = []string + var DefaultTimeFormat = "2006/01/02 15:04:05" + var DoNothingOnExit = func(code int) + var ErrorKey = "error" + var FieldKeyCaller = "caller" + var FieldKeyChannel = "channel" + var FieldKeyData = "data" + var FieldKeyDatetime = "datetime" + var FieldKeyError = "error" + var FieldKeyExtra = "extra" + var FieldKeyFLine = "fline" + var FieldKeyFcName = "fcname" + var FieldKeyFile = "file" + var FieldKeyFunc = "func" + var FieldKeyLevel = "level" + var FieldKeyMessage = "message" + var FieldKeyPkg = "package" + var FieldKeyTime = "time" + var FieldKeyTimestamp = "timestamp" + var LevelNames = map[Level]string + var NoTimeFields = []string + var NormalLevels = Levels + var PrintLevel = InfoLevel + func AddHandler(h Handler) + func AddHandlers(hs ...Handler) + func AddProcessor(p Processor) + func AddProcessors(ps ...Processor) + func Configure(fn func(logger *SugaredLogger)) + func Debug(args ...interface{}) + func Debugf(format string, args ...interface{}) + func EncodeToString(v interface{}) string + func Error(args ...interface{}) + func ErrorT(err error) + func Errorf(format string, args ...interface{}) + func Exit(code int) + func ExitHandlers() []func() + func Fatal(args ...interface{}) + func Fatalf(format string, args ...interface{}) + func Flush() error + func FlushDaemon() + func FlushTimeout(timeout time.Duration) + func Info(args ...interface{}) + func Infof(format string, args ...interface{}) + func LevelName(l Level) string + func Notice(args ...interface{}) + func Noticef(format string, args ...interface{}) + func Panic(args ...interface{}) + func Panicf(format string, args ...interface{}) + func PrependExitHandler(handler func()) + func Print(args ...interface{}) + func Printf(format string, args ...interface{}) + func Println(args ...interface{}) + func PushHandler(h Handler) + func PushHandlers(hs ...Handler) + func RegisterExitHandler(handler func()) + func Reset() + func ResetExitHandlers(applyToStd bool) + func SetExitFunc(fn func(code int)) + func SetFormatter(f Formatter) + func SetLogLevel(l Level) + func Trace(args ...interface{}) + func Tracef(format string, args ...interface{}) + func Warn(args ...interface{}) + func Warnf(format string, args ...interface{}) + type FlushCloseWriter interface + Flush func() error + type Formattable struct + func (f *Formattable) FormatRecord(record *Record) ([]byte, error) + func (f *Formattable) Formatter() Formatter + func (f *Formattable) SetFormatter(formatter Formatter) + type FormattableHandler interface + Formatter func() Formatter + SetFormatter func(Formatter) + type Formatter interface + Format func(record *Record) ([]byte, error) + func GetFormatter() Formatter + type FormatterFunc func(r *Record) error + func (fn FormatterFunc) Format(r *Record) error + type FormatterWriterHandler interface + Formatter func() Formatter + Writer func() io.Writer + type Handler interface + Flush func() error + Handle func(*Record) error + IsHandling func(level Level) bool + type JSONFormatter struct + Aliases StringMap + Fields []string + PrettyPrint bool + TimeFormat string + func NewJSONFormatter(fn ...func(*JSONFormatter)) *JSONFormatter + func (f *JSONFormatter) Configure(fn func(*JSONFormatter)) *JSONFormatter + func (f *JSONFormatter) Format(r *Record) ([]byte, error) + type Level uint32 + const DebugLevel + const ErrorLevel + const FatalLevel + const InfoLevel + const NoticeLevel + const PanicLevel + const TraceLevel + const WarnLevel + func MustLevelByName(ln string) Level + func Name2Level(ln string) (Level, error) + func (l Level) LowerName() string + func (l Level) Name() string + func (l Level) ShouldHandling(curLevel Level) bool + func (l Level) String() string + type Levels []Level + func (ls Levels) Contains(level Level) bool + type Logger struct + ExitFunc func(code int) + LowerLevelName bool + MaxCallerDepth int + ReportCaller bool + func New() *Logger + func NewWithConfig(fn func(l *Logger)) *Logger + func NewWithHandlers(hs ...Handler) *Logger + func NewWithName(name string) *Logger + func (l *Logger) AddHandler(h Handler) + func (l *Logger) AddHandlers(hs ...Handler) + func (l *Logger) AddProcessor(p Processor) + func (l *Logger) AddProcessors(ps ...Processor) + func (l *Logger) Close() + func (l *Logger) Configure(fn func(l *Logger)) *Logger + func (l *Logger) Debug(args ...interface{}) + func (l *Logger) Debugf(format string, args ...interface{}) + func (l *Logger) Error(args ...interface{}) + func (l *Logger) ErrorT(err error) + func (l *Logger) Errorf(format string, args ...interface{}) + func (l *Logger) Exit(code int) + func (l *Logger) ExitHandlers() []func() + func (l *Logger) Fatal(args ...interface{}) + func (l *Logger) Fatalf(format string, args ...interface{}) + func (l *Logger) Fatalln(args ...interface{}) + func (l *Logger) Flush() + func (l *Logger) FlushAll() + func (l *Logger) FlushDaemon() + func (l *Logger) FlushTimeout(timeout time.Duration) + func (l *Logger) Info(args ...interface{}) + func (l *Logger) Infof(format string, args ...interface{}) + func (l *Logger) Log(level Level, args ...interface{}) + func (l *Logger) Logf(level Level, format string, args ...interface{}) + func (l *Logger) Name() string + 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) Panicln(args ...interface{}) + func (l *Logger) PrependExitHandler(handler func()) + func (l *Logger) Print(args ...interface{}) + func (l *Logger) Printf(format string, args ...interface{}) + func (l *Logger) Println(args ...interface{}) + func (l *Logger) PushHandler(h Handler) + func (l *Logger) PushHandlers(hs ...Handler) + func (l *Logger) PushProcessor(p Processor) + func (l *Logger) RegisterExitHandler(handler func()) + func (l *Logger) Reset() + func (l *Logger) ResetExitHandlers() + func (l *Logger) ResetHandlers() + func (l *Logger) ResetProcessors() + func (l *Logger) SetHandlers(hs []Handler) + func (l *Logger) SetName(name string) + func (l *Logger) SetProcessors(ps []Processor) + func (l *Logger) Sync() error + func (l *Logger) Trace(args ...interface{}) + func (l *Logger) Tracef(format string, args ...interface{}) + func (l *Logger) VisitAll(fn func(handler Handler) error) + func (l *Logger) Warn(args ...interface{}) + func (l *Logger) Warnf(format string, args ...interface{}) + func (l *Logger) Warning(args ...interface{}) + func (l *Logger) WithContext(ctx context.Context) *Record + func (l *Logger) WithData(data M) *Record + func (l *Logger) WithFields(fields M) *Record + func (l *Logger) WithTime(t time.Time) *Record + type M map[string]interface + func (m M) String() string + type Processable struct + func (p *Processable) AddProcessor(processor Processor) + func (p *Processable) ProcessRecord(r *Record) + type ProcessableHandler interface + AddProcessor func(Processor) + ProcessRecord func(record *Record) + type Processor interface + Process func(record *Record) + func AddHostname() Processor + func AddUniqueID(fieldName string) Processor + type ProcessorFunc func(record *Record) + var MemoryUsage ProcessorFunc = func(record *Record) { ... } + func (fn ProcessorFunc) Process(record *Record) + type Record struct + Buffer *bytes.Buffer + Caller *runtime.Frame + Channel string + Ctx context.Context + Data M + Extra M + Fields M + Level Level + Message string + Time time.Time + func WithData(data M) *Record + func WithFields(fields M) *Record + func (r *Record) AddData(data M) *Record + func (r *Record) AddExtra(data M) *Record + func (r *Record) AddField(name string, val interface{}) *Record + func (r *Record) AddFields(fields M) *Record + func (r *Record) AddValue(key string, value interface{}) *Record + func (r *Record) Copy() *Record + func (r *Record) Debug(args ...interface{}) + func (r *Record) Debugf(format string, args ...interface{}) + func (r *Record) Error(args ...interface{}) + func (r *Record) Errorf(format string, args ...interface{}) + func (r *Record) Fatal(args ...interface{}) + func (r *Record) Fatalf(format string, args ...interface{}) + func (r *Record) Fatalln(args ...interface{}) + func (r *Record) Info(args ...interface{}) + func (r *Record) Infof(format string, args ...interface{}) + func (r *Record) LevelName() string + func (r *Record) Log(level Level, args ...interface{}) + func (r *Record) Logf(level Level, format string, args ...interface{}) + func (r *Record) MicroSecond() int + func (r *Record) NewBuffer() *bytes.Buffer + func (r *Record) Notice(args ...interface{}) + func (r *Record) Noticef(format string, args ...interface{}) + func (r *Record) Panic(args ...interface{}) + func (r *Record) Panicf(format string, args ...interface{}) + func (r *Record) Panicln(args ...interface{}) + func (r *Record) Print(args ...interface{}) + func (r *Record) Printf(format string, args ...interface{}) + func (r *Record) Println(args ...interface{}) + func (r *Record) SetContext(ctx context.Context) *Record + func (r *Record) SetData(data M) *Record + func (r *Record) SetExtra(data M) *Record + func (r *Record) SetExtraValue(k string, v interface{}) + func (r *Record) SetFields(fields M) *Record + func (r *Record) SetTime(t time.Time) *Record + func (r *Record) Trace(args ...interface{}) + func (r *Record) Tracef(format string, args ...interface{}) + func (r *Record) WithContext(ctx context.Context) *Record + func (r *Record) WithData(data M) *Record + func (r *Record) WithError(err error) *Record + func (r *Record) WithField(name string, val interface{}) *Record + func (r *Record) WithFields(fields M) *Record + func (r *Record) WithTime(t time.Time) *Record + type StringMap = map[string]string + type SugaredLogger struct + Formatter Formatter + Level Level + Output io.Writer + func NewJSONSugared(out io.Writer, level Level) *SugaredLogger + func NewStdLogger() *SugaredLogger + func NewSugaredLogger(output io.Writer, level Level) *SugaredLogger + func Std() *SugaredLogger + func (sl *SugaredLogger) Close() error + func (sl *SugaredLogger) Configure(fn func(sl *SugaredLogger)) *SugaredLogger + func (sl *SugaredLogger) Flush() error + func (sl *SugaredLogger) FlushAll() error + func (sl *SugaredLogger) Handle(record *Record) error + func (sl *SugaredLogger) IsHandling(level Level) bool + func (sl *SugaredLogger) Reset() + type TextFormatter struct + ColorTheme map[Level]color.Color + EnableColor bool + EncodeFunc func(v interface{}) string + FullDisplay bool + Template string + TimeFormat string + func NewTextFormatter(template ...string) *TextFormatter + func (f *TextFormatter) FieldMap() StringMap + func (f *TextFormatter) Format(r *Record) ([]byte, error) + func (f *TextFormatter) SetTemplate(fmtTpl string)