Documentation
¶
Index ¶
- func NormalizeTheMsgtag(msgtag *loggerapi.Msgtags, n int) *loggerapi.Msgtags
- func StacktraceReadableOneliner(stacktrace []byte) string
- type Accumulator
- type Event
- func (e *Event) Array(k string, v *zerolog.Array) loggerapi.IEvent
- func (e *Event) Bytes(k string, bb []byte) loggerapi.IEvent
- func (e *Event) Caller(skip ...int) loggerapi.IEvent
- func (e *Event) Dict(k string, v *zerolog.Event) loggerapi.IEvent
- func (e *Event) Float64(k string, v float64) loggerapi.IEvent
- func (e *Event) Floats64(k string, v []float64) loggerapi.IEvent
- func (e *Event) GetTraceContext() (tc *loggerapi.TraceContext)
- func (e *Event) GetUserObject() (uo any)
- func (e *Event) IfActive(f func(ev loggerapi.IEvent)) loggerapi.IEvent
- func (e *Event) Inactive() loggerapi.IEvent
- func (e *Event) Int(k string, v int) loggerapi.IEvent
- func (e *Event) Ints(k string, v []int) loggerapi.IEvent
- func (e *Event) RawJSON(k string, rj []byte) loggerapi.IEvent
- func (e *Event) Send()
- func (e *Event) SendMsg(s string)
- func (e *Event) SendMsgf(s string, vv ...any)
- func (e *Event) SendTitle(s string)
- func (e *Event) Str(k, v string) loggerapi.IEvent
- func (e *Event) Strf(k, s string, vv ...any) loggerapi.IEvent
- func (e *Event) Strs(k string, vv []string) loggerapi.IEvent
- func (e *Event) Time(k string, t time.Time) loggerapi.IEvent
- func (e *Event) Title(s string) loggerapi.IEvent
- type Interceptor
- type Logger
- func (l *Logger) DiagnosticEvent(msgtag string) loggerapi.IEvent
- func (l *Logger) ErrEvent(err error, msgtag string) loggerapi.IEvent
- func (l *Logger) ErrorEvent(msgtag string) loggerapi.IEvent
- func (l *Logger) FinishAccumulationAndFetch() (llines []*configdb.Root)
- func (l *Logger) InfoEvent(msgtag string) loggerapi.IEvent
- func (l *Logger) RestartTheAccumulation()
- func (l *Logger) SubLoggerInitChain(msgtag string) loggerapi.ISubLoggerInitChain
- func (l *Logger) SwitchOnTheOfflineAccumulation() loggerapi.ILogger
- func (l *Logger) TraceEvent(msgtag string) loggerapi.IEvent
- func (l *Logger) WarnEvent(msgtag string) loggerapi.IEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeTheMsgtag ¶
func StacktraceReadableOneliner ¶ added in v1.27.0
Make a one-line representation of Go stracktrace, optimized to be human-readable in one-line form. It's useful when reading stacktraces logged into logging systems, where it's represented as a one-liner, with line breaks represented as \n, et al. Typical usage idiom:
e.Str("stacktrace", logger.StacktraceReadableOneliner(debug.Stack()))
Types ¶
type Accumulator ¶ added in v1.65.1
type Accumulator struct {
// contains filtered or unexported fields
}
func NewAccumulator ¶ added in v1.65.1
func NewAccumulator() *Accumulator
func (*Accumulator) FinishAccumulationAndFetch ¶ added in v1.65.1
func (a *Accumulator) FinishAccumulationAndFetch() []*configdb.Root
type Event ¶
type Event struct {
ParentLogger *Logger
IsInactive bool // per event
TheLevel string // per event
TheTitle string // per event
ZerologEvent *zerolog.Event
// contains filtered or unexported fields
}
func (*Event) GetTraceContext ¶ added in v1.65.1
func (e *Event) GetTraceContext() (tc *loggerapi.TraceContext)
func (*Event) GetUserObject ¶ added in v1.65.1
type Interceptor ¶ added in v1.65.1
type Interceptor struct {
// contains filtered or unexported fields
}
type Logger ¶
type Logger struct {
RootContext *loggerapi.RootContext
IsInactive bool // per logger
UserObject any
TraceContext *loggerapi.TraceContext
ZeroLogger *zerolog.Logger
// contains filtered or unexported fields
}
Single-thread only! Use sub-loggers if want to use it concurrently
func (*Logger) DiagnosticEvent ¶ added in v1.65.1
func (*Logger) ErrorEvent ¶ added in v1.17.0
func (*Logger) FinishAccumulationAndFetch ¶ added in v1.65.1
func (*Logger) RestartTheAccumulation ¶ added in v1.65.1
func (l *Logger) RestartTheAccumulation()
func (*Logger) SubLoggerInitChain ¶
func (l *Logger) SubLoggerInitChain(msgtag string) loggerapi.ISubLoggerInitChain
func (*Logger) SwitchOnTheOfflineAccumulation ¶ added in v1.65.1
func (*Logger) TraceEvent ¶ added in v1.17.0
Source Files
¶
Click to show internal directories.
Click to hide internal directories.