gologadapter

package
v0.2.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2021 License: BSD-3-Clause Imports: 5 Imported by: 2

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAdapter

func GetAdapter() tracing.Adapter

GetAdapter creates an adapter (i.e., factory for tracing.Trace) to be used to initialize (global) tracers.

func New

func New() tracing.Trace

New creates a new Tracer instance based on a Go logger.

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) Debugf

func (t *Tracer) Debugf(s string, args ...interface{})

Debugf is part of interface Trace

func (*Tracer) Errorf

func (t *Tracer) Errorf(s string, args ...interface{})

Errorf is part of interface Trace

func (*Tracer) GetTraceLevel

func (t *Tracer) GetTraceLevel() tracing.TraceLevel

GetTraceLevel is part of interface Trace

func (*Tracer) Infof

func (t *Tracer) Infof(s string, args ...interface{})

Infof is part of interface Trace

func (*Tracer) P

func (t *Tracer) P(key string, val interface{}) tracing.Trace

P is part of interface Trace

func (*Tracer) SetOutput

func (t *Tracer) SetOutput(writer io.Writer)

SetOutput is part of interface Trace

func (*Tracer) SetTraceLevel

func (t *Tracer) SetTraceLevel(l tracing.TraceLevel)

SetTraceLevel is part of interface Trace

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL