Versions in this module Expand all Collapse all v0 v0.1.2 Dec 22, 2021 v0.1.1 Dec 22, 2021 Changes in this version + const ErrInvalidXID + const TimeFormatUnix + const TimeFormatUnixMs + var DefaultLogger = Logger + func Fastrandn(x uint32) uint32 + func Goid() (n int64) — js/wasm + func Goid() int64 — darwin/amd64, linux/amd64, windows/amd64 + func IsTerminal(fd uintptr) bool + func Printf(format string, v ...interface{}) + func Show(show bool) + type AsyncWriter struct + ChannelSize uint + Writer Writer + func (w *AsyncWriter) Close() (err error) + func (w *AsyncWriter) WriteEntry(e *Entry) (int, error) + type ConsoleWriter struct + ColorOutput bool + EndWithMessage bool + Formatter func(w io.Writer, args *FormatterArgs) (n int, err error) + QuoteString bool + Writer io.Writer + func (w *ConsoleWriter) Close() (err error) + func (w *ConsoleWriter) WriteEntry(e *Entry) (int, error) + func (w *ConsoleWriter) WriteEntry(e *Entry) (n int, err error) + type Context []byte + type Entry struct + Level Level + func Debug() (e *Entry) + func Error() (e *Entry) + func Fatal() (e *Entry) + func Info() (e *Entry) + func NewContext(dst []byte) (e *Entry) + func Panic() (e *Entry) + func Trace() (e *Entry) + func Warn() (e *Entry) + func (e *Entry) AnErr(key string, err error) *Entry + func (e *Entry) Bool(key string, b bool) *Entry + func (e *Entry) Bools(key string, b []bool) *Entry + func (e *Entry) Byte(key string, val byte) *Entry + func (e *Entry) Bytes(key string, val []byte) *Entry + func (e *Entry) BytesOrNil(key string, val []byte) *Entry + func (e *Entry) Caller(depth int, fullpath bool) *Entry + func (e *Entry) Context(ctx Context) *Entry + func (e *Entry) Dict(key string, ctx Context) *Entry + func (e *Entry) Discard() *Entry + func (e *Entry) Dur(key string, d time.Duration) *Entry + func (e *Entry) Durs(key string, d []time.Duration) *Entry + func (e *Entry) EmbedObject(obj ObjectMarshaler) *Entry + func (e *Entry) Enabled() bool + func (e *Entry) Err(err error) *Entry + func (e *Entry) Errs(key string, errs []error) *Entry + func (e *Entry) Fields(fields Fields) *Entry + func (e *Entry) Float32(key string, f float32) *Entry + func (e *Entry) Float64(key string, f float64) *Entry + func (e *Entry) Floats32(key string, f []float32) *Entry + func (e *Entry) Floats64(key string, f []float64) *Entry + func (e *Entry) Func(f func(e *Entry)) *Entry + func (e *Entry) GoStringer(key string, val fmt.GoStringer) *Entry + func (e *Entry) Hex(key string, val []byte) *Entry + func (e *Entry) IPAddr(key string, ip net.IP) *Entry + func (e *Entry) IPPrefix(key string, pfx net.IPNet) *Entry + func (e *Entry) Int(key string, i int) *Entry + func (e *Entry) Int16(key string, i int16) *Entry + func (e *Entry) Int32(key string, i int32) *Entry + func (e *Entry) Int64(key string, i int64) *Entry + func (e *Entry) Int8(key string, i int8) *Entry + func (e *Entry) Interface(key string, i interface{}) *Entry + func (e *Entry) Ints(key string, a []int) *Entry + func (e *Entry) Ints16(key string, a []int16) *Entry + func (e *Entry) Ints32(key string, a []int32) *Entry + func (e *Entry) Ints64(key string, a []int64) *Entry + func (e *Entry) Ints8(key string, a []int8) *Entry + func (e *Entry) KeysAndValues(keysAndValues ...interface{}) *Entry + func (e *Entry) MACAddr(key string, ha net.HardwareAddr) *Entry + func (e *Entry) Msg(msg string) + func (e *Entry) Msgf(format string, v ...interface{}) + func (e *Entry) Msgs(args ...interface{}) + func (e *Entry) Object(key string, obj ObjectMarshaler) *Entry + func (e *Entry) RawJSON(key string, b []byte) *Entry + func (e *Entry) RawJSONStr(key string, s string) *Entry + func (e *Entry) Stack() *Entry + func (e *Entry) Str(key string, val string) *Entry + func (e *Entry) StrInt(key string, val int64) *Entry + func (e *Entry) Stringer(key string, val fmt.Stringer) *Entry + func (e *Entry) Strs(key string, vals []string) *Entry + func (e *Entry) Time(key string, t time.Time) *Entry + func (e *Entry) TimeDiff(key string, t time.Time, start time.Time) *Entry + func (e *Entry) TimeFormat(key string, timefmt string, t time.Time) *Entry + func (e *Entry) Times(key string, a []time.Time) *Entry + func (e *Entry) TimesFormat(key string, timefmt string, a []time.Time) *Entry + func (e *Entry) Uint(key string, i uint) *Entry + func (e *Entry) Uint16(key string, i uint16) *Entry + func (e *Entry) Uint32(key string, i uint32) *Entry + func (e *Entry) Uint64(key string, i uint64) *Entry + func (e *Entry) Uint8(key string, i uint8) *Entry + func (e *Entry) Uints(key string, a []uint) *Entry + func (e *Entry) Uints16(key string, a []uint16) *Entry + func (e *Entry) Uints32(key string, a []uint32) *Entry + func (e *Entry) Uints64(key string, a []uint64) *Entry + func (e *Entry) Uints8(key string, a []uint8) *Entry + func (e *Entry) Value() Context + func (e *Entry) Xid(key string, xid [12]byte) *Entry + type EventlogWriter struct — windows/amd64 + Host string + ID uintptr + Source string + func (w *EventlogWriter) Close() (err error) + func (w *EventlogWriter) WriteEntry(e *Entry) (n int, err error) + type Fields map[string]interface + type FileWriter struct + Cleaner func(filename string, maxBackups int, matches []os.FileInfo) + EnsureFolder bool + FileMode os.FileMode + Filename string + Header func(fileinfo os.FileInfo) []byte + HostName bool + LocalTime bool + MaxBackups int + MaxSize int64 + ProcessID bool + TimeFormat string + func (w *FileWriter) Close() (err error) + func (w *FileWriter) Rotate() (err error) + func (w *FileWriter) Write(p []byte) (n int, err error) + func (w *FileWriter) WriteEntry(e *Entry) (n int, err error) + type FormatterArgs struct + Caller string + Goid string + KeyValues []struct{ ... } + Level string + Message string + Stack string + Time string + func (args *FormatterArgs) Get(key string) (value string) + type GrcpGatewayLogger struct + func (g GrcpGatewayLogger) Debug(msg string) + func (g GrcpGatewayLogger) Error(msg string) + func (g GrcpGatewayLogger) Info(msg string) + func (g GrcpGatewayLogger) Warning(msg string) + func (g GrcpGatewayLogger) WithValues(keysAndValues ...interface{}) GrcpGatewayLogger + type GrpcLogger struct + func (g *GrpcLogger) Error(args ...interface{}) + func (g *GrpcLogger) Errorf(format string, args ...interface{}) + func (g *GrpcLogger) Errorln(args ...interface{}) + func (g *GrpcLogger) Fatal(args ...interface{}) + func (g *GrpcLogger) Fatalf(format string, args ...interface{}) + func (g *GrpcLogger) Fatalln(args ...interface{}) + func (g *GrpcLogger) Info(args ...interface{}) + func (g *GrpcLogger) Infof(format string, args ...interface{}) + func (g *GrpcLogger) Infoln(args ...interface{}) + func (g *GrpcLogger) V(level int) bool + func (g *GrpcLogger) Warning(args ...interface{}) + func (g *GrpcLogger) Warningf(format string, args ...interface{}) + func (g *GrpcLogger) Warningln(args ...interface{}) + type IOWriter struct + func (w IOWriter) WriteEntry(e *Entry) (n int, err error) + type JournalWriter struct — linux/amd64 + JournalSocket string + func (w *JournalWriter) Close() (err error) + func (w *JournalWriter) WriteEntry(e *Entry) (n int, err error) + type Level uint32 + const DebugLevel + const ErrorLevel + const FatalLevel + const InfoLevel + const PanicLevel + const TraceLevel + const WarnLevel + func ParseLevel(s string) (level Level) + func (l Level) String() (s string) + type Logger struct + Caller int + Context Context + FullpathCaller bool + Level Level + TimeField string + TimeFormat string + Writer Writer + func (l *Logger) Debug() (e *Entry) + func (l *Logger) Err(err error) (e *Entry) + func (l *Logger) Error() (e *Entry) + func (l *Logger) Fatal() (e *Entry) + func (l *Logger) GrcpGateway() GrcpGatewayLogger + func (l *Logger) Grpc(context Context) (g *GrpcLogger) + func (l *Logger) Info() (e *Entry) + func (l *Logger) Log() (e *Entry) + func (l *Logger) Logr(context Context) *LogrLogger + func (l *Logger) Panic() (e *Entry) + func (l *Logger) Printf(format string, v ...interface{}) + func (l *Logger) SetLevel(level Level) + func (l *Logger) Std(level Level, context Context, prefix string, flag int) *stdLog.Logger + func (l *Logger) Trace() (e *Entry) + func (l *Logger) Warn() (e *Entry) + func (l *Logger) WithLevel(level Level) (e *Entry) + type LogrLogger struct + func (l *LogrLogger) Enabled() bool + func (l *LogrLogger) Error(err error, msg string, keysAndValues ...interface{}) + func (l *LogrLogger) Info(msg string, keysAndValues ...interface{}) + func (l *LogrLogger) V(level int) *LogrLogger + func (l *LogrLogger) WithName(name string) *LogrLogger + func (l *LogrLogger) WithValues(keysAndValues ...interface{}) *LogrLogger + type MultiEntryWriter []Writer + func (w *MultiEntryWriter) Close() (err error) + func (w *MultiEntryWriter) WriteEntry(e *Entry) (n int, err error) + type MultiIOWriter []io.Writer + func (w *MultiIOWriter) Close() (err error) + func (w *MultiIOWriter) WriteEntry(e *Entry) (n int, err error) + type MultiLevelWriter struct + ConsoleLevel Level + ConsoleWriter Writer + ErrorWriter Writer + InfoWriter Writer + WarnWriter Writer + func (w *MultiLevelWriter) Close() (err error) + func (w *MultiLevelWriter) WriteEntry(e *Entry) (n int, err error) + type MultiWriter = MultiLevelWriter + type ObjectMarshaler interface + MarshalObject func(e *Entry) + type SyslogWriter struct + Address string + Dial func(network, addr string) (net.Conn, error) + Hostname string + Marker string + Network string + Tag string + func (w *SyslogWriter) Close() (err error) + func (w *SyslogWriter) WriteEntry(e *Entry) (n int, err error) + type TSVEntry struct + func (e *TSVEntry) Bool(b bool) *TSVEntry + func (e *TSVEntry) Byte(b byte) *TSVEntry + func (e *TSVEntry) Bytes(val []byte) *TSVEntry + func (e *TSVEntry) Caller(depth int) *TSVEntry + func (e *TSVEntry) Float32(f float32) *TSVEntry + func (e *TSVEntry) Float64(f float64) *TSVEntry + func (e *TSVEntry) IPAddr(ip net.IP) *TSVEntry + func (e *TSVEntry) Int(i int) *TSVEntry + func (e *TSVEntry) Int16(i int16) *TSVEntry + func (e *TSVEntry) Int32(i int32) *TSVEntry + func (e *TSVEntry) Int64(i int64) *TSVEntry + func (e *TSVEntry) Int8(i int8) *TSVEntry + func (e *TSVEntry) Msg() + func (e *TSVEntry) Str(val string) *TSVEntry + func (e *TSVEntry) Timestamp() *TSVEntry + func (e *TSVEntry) TimestampMS() *TSVEntry + func (e *TSVEntry) Uint(i uint) *TSVEntry + func (e *TSVEntry) Uint16(i uint16) *TSVEntry + func (e *TSVEntry) Uint32(i uint32) *TSVEntry + func (e *TSVEntry) Uint64(i uint64) *TSVEntry + func (e *TSVEntry) Uint8(i uint8) *TSVEntry + type TSVLogger struct + Separator byte + Writer io.Writer + func (l *TSVLogger) New() (e *TSVEntry) + type Writer interface + WriteEntry func(*Entry) (int, error) + type XID [12]byte + func NewXID() XID + func NewXIDWithTime(timestamp int64) (x XID) + func ParseXID(s string) (x XID, err error) + func (x *XID) UnmarshalJSON(b []byte) (err error) + func (x *XID) UnmarshalText(text []byte) (err error) + func (x XID) Counter() uint32 + func (x XID) Machine() []byte + func (x XID) MarshalJSON() (dst []byte, err error) + func (x XID) MarshalText() (dst []byte, err error) + func (x XID) Pid() uint16 + func (x XID) String() string + func (x XID) Time() time.Time