Documentation ¶
Index ¶
- Constants
- func TypeOf[T any]() string
- func WithTelemetry() bool
- type CodePath
- type CodefReference
- type Console
- type ContextKey
- type Identifier
- type Log
- type LogField
- func DebugField(key string, value string) *LogField
- func DirField(dir string) *LogField
- func ErrField(err error) *LogField
- func ErrorField(s string, value any) *LogField
- func Field(key string, value any) *LogField
- func FileField(file string) *LogField
- func GenericField[T any]() *LogField
- func InfoField(key string, value any) *LogField
- func NameField(name string) *LogField
- func PathField(dir string) *LogField
- func PointerField[T any](override *T) *LogField
- func RequestField(req any) *LogField
- func SliceCountField[T any](slice []T) *LogField
- func StatusFailed() *LogField
- func StatusOK() *LogField
- func ThisField(this Unique) *LogField
- func TraceField(key string, value string) *LogField
- func WarnField(key string, value any) *LogField
- type LogProcessor
- type LogProcessorWithSource
- type Loglevel
- type Otel
- type Provider
- type Resource
- type Unique
- type Wool
- func (c *Wool) Catch()
- func (c *Wool) Close()
- func (c *Wool) Context() context.Context
- func (c *Wool) Debug(msg string, fields ...*LogField)
- func (c *Wool) Error(msg string, fields ...*LogField)
- func (c *Wool) Fatal(msg string, fields ...*LogField)
- func (w *Wool) File() string
- func (c *Wool) In(method string, fields ...*LogField) *Wool
- func (c *Wool) Info(msg string, fields ...*LogField)
- func (c *Wool) Name() string
- func (c *Wool) NewError(format string, args ...any) error
- func (c *Wool) StackTrace() []CodePath
- func (c *Wool) Trace(msg string, fields ...*LogField)
- func (c *Wool) Warn(msg string, fields ...*LogField)
- func (c *Wool) WithLogger(l LogProcessor) *Wool
- func (c *Wool) Wrap(err error) error
- func (c *Wool) Wrapf(err error, msg string, args ...any) 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 WithTelemetry ¶
func WithTelemetry() bool
Types ¶
type CodefReference ¶ added in v0.0.55
type ContextKey ¶
type ContextKey string
type Identifier ¶ added in v0.0.55
type Log ¶
type Log struct { Level Loglevel `json:"level"` Message string `json:"message"` Header string `json:"header"` 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 DebugField ¶
func ErrorField ¶ added in v0.0.55
func GenericField ¶ added in v0.0.55
func PointerField ¶ added in v0.0.57
func RequestField ¶ added in v0.0.55
func SliceCountField ¶ added in v0.0.57
func StatusFailed ¶ added in v0.0.55
func StatusFailed() *LogField
func TraceField ¶ added in v0.0.55
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 Provider ¶ added in v0.0.55
type Provider struct {
// contains filtered or unexported fields
}
Provider keeping track
func (*Provider) WithContext ¶ added in v0.0.55
func (*Provider) WithLogger ¶ added in v0.0.55
func (w *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 (c *Wool) Catch()
Catch recovers from a panic and logs the error
func (*Wool) StackTrace ¶ added in v0.0.55
func (*Wool) WithLogger ¶ added in v0.0.55
func (c *Wool) WithLogger(l LogProcessor) *Wool
Click to show internal directories.
Click to hide internal directories.