Documentation ¶
Index ¶
- Constants
- func IsDebug() bool
- func SetGlobalLogLevel(loglevel Loglevel)
- func TypeOf[T any]() string
- func WithTelemetry() bool
- type CodePath
- type CodeReference
- type Console
- type ContextKey
- type Identifier
- type Log
- type LogField
- func DirField(dir string) *LogField
- func ErrField(err error) *LogField
- func Field(key string, value any) *LogField
- func FileField(file string) *LogField
- func FocusField() *LogField
- func GenericField[T any]() *LogField
- func InField(s string) *LogField
- func NameField(name string) *LogField
- func NullableField[T any](key string, value T) *LogField
- func PathField(dir string) *LogField
- func PointerField[T any](override *T) *LogField
- func RequestField(req any) *LogField
- func ResponseField(req any) *LogField
- func SliceCountField[T any](slice []T) *LogField
- func StatusFailed() *LogField
- func StatusOK() *LogField
- func ThisField(this Unique) *LogField
- func Writer() *LogField
- type LogProcessor
- type LogProcessorWithSource
- type Loglevel
- type Provider
- type Resource
- type Unique
- type Wool
- func (w *Wool) Catch()
- func (w *Wool) Close()
- func (w *Wool) Debug(msg string, fields ...*LogField)
- func (w *Wool) Error(msg string, fields ...*LogField)
- func (w *Wool) Fatal(msg string, fields ...*LogField)
- func (w *Wool) Focus(msg string, fields ...*LogField)
- func (w *Wool) Forward(p []byte) (n int, err error)
- func (w *Wool) In(method string, fields ...*LogField) *Wool
- func (w *Wool) Info(msg string, fields ...*LogField)
- func (w *Wool) Inject(ctx context.Context) context.Context
- func (w *Wool) Name() string
- func (w *Wool) NewError(format string, args ...any) error
- func (w *Wool) Source() *Identifier
- func (w *Wool) StackTrace() []CodePath
- func (w *Wool) Trace(msg string, fields ...*LogField)
- func (w *Wool) Warn(msg string, fields ...*LogField)
- func (w *Wool) With(fields ...*LogField) *Wool
- func (w *Wool) WithLogger(l LogProcessor) *Wool
- func (w *Wool) WithLoglevel(level Loglevel)
- func (w *Wool) Wrap(err error) error
- func (w *Wool) Wrapf(err error, msg string, args ...any) error
- func (w *Wool) Write(p []byte) (n int, err error)
Constants ¶
View Source
const CodePathKey = "codepath"
View Source
const KeyInContext = ContextKey("provider")
View Source
const LogEvent = "log"
Variables ¶
This section is empty.
Functions ¶
func SetGlobalLogLevel ¶ added in v0.0.65
func SetGlobalLogLevel(loglevel Loglevel)
func WithTelemetry ¶
func WithTelemetry() bool
Types ¶
type CodeReference ¶ added in v0.0.60
func (*CodeReference) String ¶ added in v0.0.71
func (c *CodeReference) String() string
type ContextKey ¶
type ContextKey string
type Identifier ¶ added in v0.0.55
func System ¶ added in v0.0.67
func System() *Identifier
func (*Identifier) IsSystem ¶ added in v0.0.67
func (identifier *Identifier) IsSystem() bool
type Log ¶
type Log struct { Level Loglevel `json:"level"` Header string `json:"header"` Message string `json:"message"` Fields []*LogField `json:"fields"` }
func (*Log) Event ¶
func (l *Log) Event() trace.SpanStartEventOption
type LogField ¶
type LogField struct { Key string `json:"key"` Level Loglevel `json:"level"` Value any `json:"value"` }
LogField is a key value pair with a log level A Field is shown only if the log level is equal or higher than the log level of the log
func FocusField ¶ added in v0.0.69
func FocusField() *LogField
func GenericField ¶ added in v0.0.55
func NullableField ¶ added in v0.0.81
func PointerField ¶ added in v0.0.57
func RequestField ¶ added in v0.0.55
func ResponseField ¶ added in v0.0.67
func SliceCountField ¶ added in v0.0.57
func StatusFailed ¶ added in v0.0.55
func StatusFailed() *LogField
type LogProcessor ¶ added in v0.0.55
type LogProcessor interface {
Process(msg *Log)
}
type LogProcessorWithSource ¶ added in v0.0.55
type LogProcessorWithSource interface {
ProcessWithSource(msg *Log, source *Identifier)
}
type Loglevel ¶
type Loglevel int
func GlobalLogLevel ¶ added in v0.0.65
func GlobalLogLevel() Loglevel
type Provider ¶ added in v0.0.55
type Provider struct {
// contains filtered or unexported fields
}
Provider keeping track
func (*Provider) WithConsole ¶ added in v0.0.69
func (*Provider) WithLogger ¶ added in v0.0.55
func (provider *Provider) WithLogger(l LogProcessor) *Provider
type Resource ¶ added in v0.0.55
type Resource struct { Resource *resource.Resource *Identifier }
type Wool ¶
type Wool struct {
// contains filtered or unexported fields
}
func (*Wool) Catch ¶ added in v0.0.55
func (w *Wool) Catch()
Catch recovers from a panic and logs the error
func (*Wool) Source ¶ added in v0.0.67
func (w *Wool) Source() *Identifier
func (*Wool) StackTrace ¶ added in v0.0.55
func (*Wool) WithLogger ¶ added in v0.0.55
func (w *Wool) WithLogger(l LogProcessor) *Wool
func (*Wool) WithLoglevel ¶ added in v0.0.87
Click to show internal directories.
Click to hide internal directories.