Documentation ¶
Index ¶
- func Caller(depth int) string
- func Debug(ctx context.Context, a ...interface{})
- func DebugKV(ctx context.Context, key string, value interface{})
- func DebugKVs(ctx context.Context, kvs ...kv.Field)
- func Debugf(ctx context.Context, s string, a ...interface{})
- func EnableSyslog(proto, addr string) error
- func Error(ctx context.Context, a ...interface{})
- func ErrorKV(ctx context.Context, key string, value interface{})
- func ErrorKVs(ctx context.Context, kvs ...kv.Field)
- func Errorf(ctx context.Context, s string, a ...interface{})
- func Hook(hook func(ctx context.Context, kvs []kv.Field) []kv.Field)
- func Info(ctx context.Context, a ...interface{})
- func InfoKV(ctx context.Context, key string, value interface{})
- func InfoKVs(ctx context.Context, kvs ...kv.Field)
- func Infof(ctx context.Context, s string, a ...interface{})
- func Log(ctx context.Context, lvl LEVEL, a ...interface{})
- func LogKV(ctx context.Context, lvl LEVEL, key string, value interface{})
- func LogKVs(ctx context.Context, lvl LEVEL, kvs ...kv.Field)
- func Logf(ctx context.Context, lvl LEVEL, s string, a ...interface{})
- func Panic(ctx context.Context, a ...interface{})
- func PanicKV(ctx context.Context, key string, value interface{})
- func PanicKVs(ctx context.Context, kvs ...kv.Field)
- func Panicf(ctx context.Context, s string, a ...interface{})
- func ParseLevel(str string) error
- func Print(a ...interface{})
- func PrintKV(key string, value interface{})
- func PrintKVs(kvs ...kv.Field)
- func Printf(s string, a ...interface{})
- func SetLevel(lvl LEVEL)
- func SetTimeFormat(format string)
- func TimeFormat() string
- func Trace(ctx context.Context, a ...interface{})
- func TraceKV(ctx context.Context, key string, value interface{})
- func TraceKVs(ctx context.Context, kvs ...kv.Field)
- func Tracef(ctx context.Context, s string, a ...interface{})
- func VarDump(a any) string
- func Warn(ctx context.Context, a ...interface{})
- func WarnKV(ctx context.Context, key string, value interface{})
- func WarnKVs(ctx context.Context, kvs ...kv.Field)
- func Warnf(ctx context.Context, s string, a ...interface{})
- type Entry
- func (e Entry) Debug(a ...interface{})
- func (e Entry) Debugf(s string, a ...interface{})
- func (e Entry) Error(a ...interface{})
- func (e Entry) Errorf(s string, a ...interface{})
- func (e Entry) Info(a ...interface{})
- func (e Entry) Infof(s string, a ...interface{})
- func (e Entry) Log(lvl LEVEL, a ...interface{})
- func (e Entry) Logf(lvl LEVEL, s string, a ...interface{})
- func (e Entry) Panic(a ...interface{})
- func (e Entry) Panicf(s string, a ...interface{})
- func (e Entry) Print(a ...interface{})
- func (e Entry) Printf(s string, a ...interface{})
- func (e Entry) Trace(a ...interface{})
- func (e Entry) Tracef(s string, a ...interface{})
- func (e Entry) Warn(a ...interface{})
- func (e Entry) Warnf(s string, a ...interface{})
- func (e Entry) WithContext(ctx context.Context) Entry
- func (e Entry) WithField(key string, value interface{}) Entry
- func (e Entry) WithFields(kvs ...kv.Field) Entry
- type LEVEL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶ added in v0.3.8
Debug will log formatted args as 'msg' field to the log at DEBUG level.
func Debugf ¶ added in v0.3.8
Debugf will log format string as 'msg' field to the log at DEBUG level.
func EnableSyslog ¶ added in v0.3.8
EnableSyslog will enabling logging to the syslog at given address.
func Error ¶ added in v0.3.8
Error will log formatted args as 'msg' field to the log at ERROR level.
func Errorf ¶ added in v0.3.8
Errorf will log format string as 'msg' field to the log at ERROR level.
func Panic ¶ added in v0.3.8
Panic will log formatted args as 'msg' field to the log at PANIC level. This will then call panic causing the application to crash.
func PanicKV ¶ added in v0.17.0
PanicKV will log the one key-value field to the log at PANIC level. This will then call panic causing the application to crash.
func PanicKVs ¶ added in v0.17.0
PanicKVs will log key-value fields to the log at PANIC level. This will then call panic causing the application to crash.
func Panicf ¶ added in v0.3.8
Panicf will log format string as 'msg' field to the log at PANIC level. This will then call panic causing the application to crash.
func ParseLevel ¶ added in v0.3.8
ParseLevel will parse the log level from given string and set to appropriate LEVEL.
func Print ¶ added in v0.3.8
func Print(a ...interface{})
Print will log formatted args to the stdout log output.
func PrintKV ¶ added in v0.17.0
func PrintKV(key string, value interface{})
PrintKVs will log the one key-value field to the stdout log output.
func PrintKVs ¶ added in v0.17.0
func PrintKVs(kvs ...kv.Field)
PrintKVs will log key-value fields to the stdout log output.
func Printf ¶ added in v0.3.8
func Printf(s string, a ...interface{})
Printf will log format string to the stdout log output.
func SetTimeFormat ¶ added in v0.12.0
func SetTimeFormat(format string)
SetTimeFormat sets the timestamp format to the given string.
func TimeFormat ¶ added in v0.12.0
func TimeFormat() string
TimeFormat returns the currently-set timestamp format.
func Trace ¶ added in v0.3.8
Trace will log formatted args as 'msg' field to the log at TRACE level.
func Tracef ¶ added in v0.3.8
Tracef will log format string as 'msg' field to the log at TRACE level.
func VarDump ¶ added in v0.13.0
VarDump returns a serialized, useful log / error output of given variable.
Types ¶
type Entry ¶ added in v0.3.8
type Entry struct {
// contains filtered or unexported fields
}
func WithContext ¶ added in v0.7.1
WithContext returns a new prepared Entry{} with context.
func WithFields ¶ added in v0.3.8
func WithFields(fields ...kv.Field) Entry
WithFields returns a new prepared Entry{} with key-value fields.
func (Entry) Debug ¶ added in v0.3.8
func (e Entry) Debug(a ...interface{})
Debug will log formatted args as 'msg' field to the log at DEBUG level.
func (Entry) Debugf ¶ added in v0.3.8
Debugf will log format string as 'msg' field to the log at DEBUG level.
func (Entry) Error ¶ added in v0.3.8
func (e Entry) Error(a ...interface{})
Error will log formatted args as 'msg' field to the log at ERROR level.
func (Entry) Errorf ¶ added in v0.3.8
Errorf will log format string as 'msg' field to the log at ERROR level.
func (Entry) Info ¶ added in v0.3.8
func (e Entry) Info(a ...interface{})
Info will log formatted args as 'msg' field to the log at INFO level.
func (Entry) Infof ¶ added in v0.3.8
Infof will log format string as 'msg' field to the log at INFO level.
func (Entry) Log ¶ added in v0.3.8
Log will log formatted args as 'msg' field to the log at given level.
func (Entry) Logf ¶ added in v0.3.8
Logf will log format string as 'msg' field to the log at given level.
func (Entry) Panic ¶ added in v0.3.8
func (e Entry) Panic(a ...interface{})
Panic will log formatted args as 'msg' field to the log at PANIC level. This will then call panic causing the application to crash.
func (Entry) Panicf ¶ added in v0.3.8
Panicf will log format string as 'msg' field to the log at PANIC level. This will then call panic causing the application to crash.
func (Entry) Print ¶ added in v0.3.8
func (e Entry) Print(a ...interface{})
Print will log formatted args to the stdout log output.
func (Entry) Trace ¶ added in v0.3.8
func (e Entry) Trace(a ...interface{})
Trace will log formatted args as 'msg' field to the log at TRACE level.
func (Entry) Tracef ¶ added in v0.3.8
Tracef will log format string as 'msg' field to the log at TRACE level.
func (Entry) Warn ¶ added in v0.3.8
func (e Entry) Warn(a ...interface{})
Warn will log formatted args as 'msg' field to the log at WARN level.
func (Entry) Warnf ¶ added in v0.3.8
Warnf will log format string as 'msg' field to the log at WARN level.
func (Entry) WithContext ¶ added in v0.7.1
WithContext updates Entry{} value context.
func (Entry) WithFields ¶ added in v0.3.8
WithFields appends key-value fields to Entry{}.