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) GetTraceContext() (tc *loggerapi.TraceContext)
- func (l *Logger) GetUserObject() (uo any)
- func (l *Logger) InfoEvent(msgtag string) loggerapi.IEvent
- func (l *Logger) NewSubLoggerInitChain(msgtag string) loggerapi.ISubLoggerInitChain
- func (l *Logger) RestartTheAccumulation()
- func (l *Logger) SpanBegin(tag string) loggerapi.ILogger
- func (l *Logger) SpanEnd()
- 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.73.0
type Accumulator struct {
// contains filtered or unexported fields
}
func NewAccumulator ¶ added in v1.73.0
func NewAccumulator() *Accumulator
func (*Accumulator) FinishAccumulationAndFetch ¶ added in v1.73.0
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.71.0
func (e *Event) GetTraceContext() (tc *loggerapi.TraceContext)
func (*Event) GetUserObject ¶ added in v1.71.0
type Interceptor ¶ added in v1.70.0
type Interceptor struct {
// contains filtered or unexported fields
}
type Logger ¶
type Logger struct { RootContext *loggerapi.RootContext IsInactive bool 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.69.0
func (*Logger) ErrorEvent ¶ added in v1.17.0
func (*Logger) FinishAccumulationAndFetch ¶ added in v1.73.0
func (l *Logger) FinishAccumulationAndFetch() (llines []*configdb.Root)
func (*Logger) GetTraceContext ¶ added in v1.74.0
func (l *Logger) GetTraceContext() (tc *loggerapi.TraceContext)
func (*Logger) GetUserObject ¶ added in v1.74.0
func (*Logger) NewSubLoggerInitChain ¶ added in v1.75.0
func (l *Logger) NewSubLoggerInitChain(msgtag string) loggerapi.ISubLoggerInitChain
func (*Logger) RestartTheAccumulation ¶ added in v1.73.0
func (l *Logger) RestartTheAccumulation()
func (*Logger) SwitchOnTheOfflineAccumulation ¶ added in v1.73.0
func (*Logger) TraceEvent ¶ added in v1.17.0
Source Files
¶
Click to show internal directories.
Click to hide internal directories.