logging

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: LGPL-3.0 Imports: 2 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompatLogger

type CompatLogger interface {
	// Printf prints a log message. Arguments are handled
	// in the/ manner of fmt.Printf.
	Printf(format string, v ...interface{})
}

CompatLogger is a minimal logging interface that may be provided when constructing a goose Client to log requests and responses, retaining compatibility with the old *log.Logger that was previously depended upon directly.

TODO(axw) in goose.v2, drop this and use loggo.Logger directly.

type CompatLoggerAdapter

type CompatLoggerAdapter struct {
	CompatLogger
}

CompatLoggerAdapter is a type wrapping CompatLogger, implementing the Logger interface.

func (CompatLoggerAdapter) Debugf

func (a CompatLoggerAdapter) Debugf(format string, v ...interface{})

Debugf is part of the Logger interface.

func (CompatLoggerAdapter) Tracef

func (a CompatLoggerAdapter) Tracef(format string, v ...interface{})

Tracef is part of the Logger interface.

func (CompatLoggerAdapter) Warningf

func (a CompatLoggerAdapter) Warningf(format string, v ...interface{})

Warningf is part of the Logger interface.

type Logger

type Logger interface {
	Debugf(format string, v ...interface{})
	Warningf(format string, v ...interface{})
	Tracef(format string, v ...interface{})
}

Logger is a logging interface that may be provided when constructing a goose Client to log requests and responses.

func FromCompat

func FromCompat(in CompatLogger) Logger

FromCompat takes a CompatLogger, and returns a Logger. This function always returns a non-nil Logger; if the input is nil, then a no-op Logger is returned.

type LoggoLogger

type LoggoLogger struct {
	loggo.Logger
}

LoggoLogger is a logger that may be provided when constructing a goose Client to log requests and responses. Users must provide a CompatLogger, which will be upgraded to Logger if provided.

func (LoggoLogger) Printf

func (l LoggoLogger) Printf(format string, v ...interface{})

Printf is part of the CompatLogger interface.

Jump to

Keyboard shortcuts

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