Versions in this module Expand all Collapse all v1 v1.0.1 May 30, 2019 Changes in this version + const LUTC + const Lcolor + const Ldate + const Llevel + const Llongfile + const Lmicroseconds + const LminFlags + const Lname + const Lpid + const Lshortfile + const LstdFlags + const Ltime + const LvlDEFAULT + var ErrNotLogged = errors.New("No handler found to log event") + func ALERT(msg string, kv ...interface{}) + func AutoColoring() + func CRIT(msg string, kv ...interface{}) + func DEBUG(msg string, kv ...interface{}) + func DecLevel() bool + func ERROR(msg string, kv ...interface{}) + func Fatal(v ...interface{}) + func Fatalf(format string, v ...interface{}) + func Fatalln(v ...interface{}) + func Flags() int + func INFO(msg string, kv ...interface{}) + func IncLevel() bool + func Level() syslog.Priority + func Log(level syslog.Priority, msg string, kv ...interface{}) + func Minimal() + func NOTICE(msg string, kv ...interface{}) + func NewJSONFormatter(w io.Writer, options ...HandlerOption) *jsonformatter + func NewMinFormatter(w io.Writer, options ...HandlerOption) *stdformatter + func NewStdFormatter(w io.Writer, prefix string, flag int) *stdformatter + func NewStdlibAdapter(logger *Logger, level syslog.Priority, options ...StdlibAdapterOption) io.Writer + func Output(calldepth int, s string) error + func Panic(v ...interface{}) + func Panicf(format string, v ...interface{}) + func Panicln(v ...interface{}) + func Prefix() string + func Print(v ...interface{}) + func Printf(format string, v ...interface{}) + func Println(v ...interface{}) + func SetFlags(flag int) + func SetLevel(level syslog.Priority) bool + func SetOutput(w io.Writer) + func SetPrefix(prefix string) + func SetPrintLevel(level syslog.Priority, respect bool) bool + func SyncWriter(w io.Writer) io.Writer + func WARN(msg string, kv ...interface{}) + func WriterFunc(fn func(b []byte) (n int, err error)) io.Writer + type CloneableHandler interface + Clone func(options ...HandlerOption) CloneableHandler + type EvWriter interface + EvWrite func(e Event, b []byte) (n int, err error) + func EventWriter(w io.Writer) EvWriter + func EventWriterFunc(fn func(e Event, b []byte) (n int, err error)) EvWriter + func LevelFilterWriter(max syslog.Priority, w io.Writer) EvWriter + func MultiEventWriter(writers ...EvWriter) EvWriter + type Event struct + func (e Event) FileInfo() (string, int) + func (e Event) KvData() KeyValues + func (e Event) Level() syslog.Priority + func (e Event) LoggerName() string + func (e Event) Message() string + func (e Event) Time() (t time.Time) + type EventKeyNames struct + File string + Line string + Lvl string + Msg string + Name string + Time string + type Handler interface + Log func(e Event) error + func FilterHandler(fn func(e Event) bool, h Handler) Handler + func HandlerFunc(fn func(e Event) error) Handler + func LvlFilterHandler(maxLvl syslog.Priority, h Handler) Handler + func MultiHandler(hs ...Handler) Handler + type HandlerOption func(CloneableHandler) + func FlagsOpt(flags int) HandlerOption + func KeyNamesOpt(keys *EventKeyNames) HandlerOption + func LevelPrefixOpt(arr *[8]string) HandlerOption + func OutputOpt(w io.Writer) HandlerOption + func PrefixOpt(prefix string) HandlerOption + func TimeFormatOpt(layout string) HandlerOption + type KV map[string]interface + func (kv KV) LogValues() KeyValues + type KeyValues []interface + type Lazy func() interface + type LevelLogger interface + Log func(level syslog.Priority, message string, kv ...interface{}) error + type LogFunc func(msg string, kv ...interface{}) + func ALERTok() (LogFunc, bool) + func CRITok() (LogFunc, bool) + func DEBUGok() (LogFunc, bool) + func ERRORok() (LogFunc, bool) + func INFOok() (LogFunc, bool) + func NOTICEok() (LogFunc, bool) + func WARNok() (LogFunc, bool) + type Logable interface + LogValues func() KeyValues + type Logger struct + func Default() *Logger + func GetLogger(name string) (l *Logger) + func New(out io.Writer, prefix string, flags int) *Logger + func NewLogger(level syslog.Priority, handler Handler) (l *Logger) + func With(kv ...interface{}) *Logger + func (l *Logger) ALERT(msg string, kv ...interface{}) + func (l *Logger) ALERTok() (LogFunc, bool) + func (l *Logger) ApplyHandlerOptions(opt ...HandlerOption) + func (l *Logger) AutoColoring() + func (l *Logger) CRIT(msg string, kv ...interface{}) + func (l *Logger) CRITok() (LogFunc, bool) + func (l *Logger) DEBUG(msg string, kv ...interface{}) + func (l *Logger) DEBUGok() (LogFunc, bool) + func (l *Logger) DecLevel() bool + func (l *Logger) DefaultLevel() syslog.Priority + func (l *Logger) Do(level syslog.Priority) bool + func (l *Logger) DoCodeInfo(doCode bool) bool + func (l *Logger) DoTime(doTime bool) bool + func (l *Logger) Does(level syslog.Priority) bool + func (l *Logger) DoingCodeInfo() bool + func (l *Logger) DoingDefaultLevel() (syslog.Priority, bool) + func (l *Logger) DoingPrintLevel() (syslog.Priority, bool) + func (l *Logger) DoingTime() bool + func (l *Logger) ERROR(msg string, kv ...interface{}) + func (l *Logger) ERRORok() (LogFunc, bool) + func (l *Logger) Fatal(v ...interface{}) + func (l *Logger) Fatalf(format string, v ...interface{}) + func (l *Logger) Fatalln(v ...interface{}) + func (l *Logger) Flags() int + func (l *Logger) INFO(msg string, kv ...interface{}) + func (l *Logger) INFOok() (LogFunc, bool) + func (l *Logger) IncLevel() bool + func (l *Logger) Level() syslog.Priority + func (l *Logger) Log(level syslog.Priority, msg string, kv ...interface{}) (err error) + func (l *Logger) LogFromCaller(calldepth int, level syslog.Priority, msg string, kv ...interface{}) error + func (l *Logger) NOTICE(msg string, kv ...interface{}) + func (l *Logger) NOTICEok() (LogFunc, bool) + func (l *Logger) Output(calldepth int, s string) error + func (l *Logger) Panic(v ...interface{}) + func (l *Logger) Panicf(format string, v ...interface{}) + func (l *Logger) Panicln(v ...interface{}) + func (l *Logger) Prefix() string + func (l *Logger) Print(v ...interface{}) + func (l *Logger) PrintLevel() syslog.Priority + func (l *Logger) Printf(format string, v ...interface{}) + func (l *Logger) Println(v ...interface{}) + func (l *Logger) SetFlags(flag int) + func (l *Logger) SetHandler(h Handler) + func (l *Logger) SetLevel(level syslog.Priority) bool + func (l *Logger) SetOutput(w io.Writer) + func (l *Logger) SetPrefix(prefix string) + func (l *Logger) SetPrintLevel(level syslog.Priority, respect bool) bool + func (l *Logger) WARN(msg string, kv ...interface{}) + func (l *Logger) WARNok() (LogFunc, bool) + func (l *Logger) With(kv ...interface{}) *Logger + type MaybeTtyWriter interface + IsTty func() bool + type StdFormatter interface + Flags func() int + Prefix func() string + type StdLogger interface + Fatal func(v ...interface{}) + Fatalf func(format string, v ...interface{}) + Fatalln func(v ...interface{}) + Panic func(v ...interface{}) + Panicf func(format string, v ...interface{}) + Panicln func(v ...interface{}) + Print func(v ...interface{}) + Printf func(format string, v ...interface{}) + Println func(v ...interface{}) + type StdLoggerFull interface + Output func(calldepth int, s string) error + type StdMutableFormatter interface + SetFlags func(flag int) + SetOutput func(w io.Writer) + SetPrefix func(prefix string) + type StdlibAdapter struct + func (a StdlibAdapter) Write(p []byte) (int, error) + type StdlibAdapterOption func(*StdlibAdapter) + func FileKey(key string) StdlibAdapterOption + func MessageKey(key string) StdlibAdapterOption + func Parse() StdlibAdapterOption + func TimestampKey(key string) StdlibAdapterOption + type StdlibWriter struct + func (w StdlibWriter) Write(p []byte) (int, error)