Documentation ¶
Overview ¶
Package gologadapter implements tracing with the default Go logger.
Tracing/logging is a cross cutting concern. Relying on a specific package for such a low-level task will create too tight a coupling—more abstract classes/packages are infected with log classes/packages.
Sub-packages of tracing implement concrete tracers. Package gologadapter uses the default Go logging mechanism.
License ¶
Governed by a 3-Clause BSD license. License file may be found in the root folder of this module.
Copyright © 2017–2021 Norbert Pillmayer <norbert@pillmayer.com>
Index ¶
- func GetAdapter() tracing.Adapter
- func New() tracing.Trace
- type Tracer
- func (t *Tracer) Debugf(s string, args ...interface{})
- func (t *Tracer) Errorf(s string, args ...interface{})
- func (t *Tracer) GetTraceLevel() tracing.TraceLevel
- func (t *Tracer) Infof(s string, args ...interface{})
- func (t *Tracer) P(key string, val interface{}) tracing.Trace
- func (t *Tracer) SetOutput(writer io.Writer)
- func (t *Tracer) SetTraceLevel(l tracing.TraceLevel)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAdapter ¶
GetAdapter creates an adapter (i.e., factory for tracing.Trace) to be used to initialize (global) tracers.
Types ¶
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
Tracer is our adapter implementation which implements interface tracing.Trace, using a Go standard logger.
func (*Tracer) GetTraceLevel ¶
func (t *Tracer) GetTraceLevel() tracing.TraceLevel
GetTraceLevel is part of interface Trace
func (*Tracer) SetTraceLevel ¶
func (t *Tracer) SetTraceLevel(l tracing.TraceLevel)
SetTraceLevel is part of interface Trace