logadapter

package
v1.25.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2020 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package logadapter defines an API to use for logging, which actual logging implementations can implement directly or provide an adapter to use.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DebugLogger

type DebugLogger interface {
	// Debug logs a debugging message. Arguments are handled in the manner of
	// fmt.Print.
	Debug(v ...interface{})
	// Debugf logs a debugging message. Arguments are handled in the manner of
	// fmt.Printf.
	Debugf(format string, v ...interface{})
}

DebugLogger defines an API to use for logging debugging messages, which actual logging implementations can implement directly or provide an adapter to use.

type Discarder

type Discarder struct {
}

Discarder discards all data given to it.

func (*Discarder) Debug

func (d *Discarder) Debug(v ...interface{})

Debug logs a debug message. Arguments are handled in the manner of fmt.Print.

func (*Discarder) Debugf

func (d *Discarder) Debugf(format string, v ...interface{})

Debugf logs a debug message. Arguments are handled in the manner of fmt.Printf.

func (*Discarder) Error

func (d *Discarder) Error(v ...interface{})

Error logs an error message. Arguments are handled in the manner of fmt.Print.

func (*Discarder) Errorf

func (d *Discarder) Errorf(format string, v ...interface{})

Errorf logs an error message. Arguments are handled in the manner of fmt.Printf.

func (*Discarder) Fatal

func (d *Discarder) Fatal(status int, v ...interface{})

Fatal logs a fatal error message. Arguments are handled in the manner of fmt.Print.

func (*Discarder) Fatalf

func (d *Discarder) Fatalf(status int, format string, v ...interface{})

Fatalf logs a fatal error message. Arguments are handled in the manner of fmt.Printf.

func (*Discarder) Info

func (d *Discarder) Info(v ...interface{})

Info logs an informational message. Arguments are handled in the manner of fmt.Print.

func (*Discarder) Infof

func (d *Discarder) Infof(format string, v ...interface{})

Infof logs an informational message. Arguments are handled in the manner of fmt.Printf.

func (*Discarder) Time

func (d *Discarder) Time(v ...interface{}) Timing

Time starts timing an event and logs an informational message. Arguments are handled in the manner of fmt.Print.

func (*Discarder) Timef

func (d *Discarder) Timef(format string, v ...interface{}) Timing

Timef starts timing an event and logs an informational message. Arguments are handled in the manner of fmt.Printf.

func (*Discarder) Warn

func (d *Discarder) Warn(v ...interface{})

Warn logs a warning message. Arguments are handled in the manner of fmt.Print.

func (*Discarder) Warnf

func (d *Discarder) Warnf(format string, v ...interface{})

Warnf logs a warning message. Arguments are handled in the manner of fmt.Printf.

type ErrorLogger

type ErrorLogger interface {
	// Error logs an error message. Arguments are handled in the manner of
	// fmt.Print.
	Error(v ...interface{})
	// Errorf logs an error message. Arguments are handled in the manner of
	// fmt.Printf.
	Errorf(format string, v ...interface{})
}

ErrorLogger defines an API to use for logging error messages, which actual logging implementations can implement directly or provide an adapter to use.

type FatalLogger

type FatalLogger interface {
	// Fatal logs a fatal error message. Arguments other than the status are
	// handled in the manner of fmt.Print.
	Fatal(status int, v ...interface{})
	// Fatalf logs a fatal error message. Arguments other than the status are
	// handled in the manner of fmt.Printf.
	Fatalf(status int, format string, v ...interface{})
}

FatalLogger defines an API to use for logging fatal error messages, which actual logging implementations can implement directly or provide an adapter to use.

type InfoLogger

type InfoLogger interface {
	// Info logs an informational message. Arguments are handled in the manner
	// of fmt.Print.
	Info(v ...interface{})
	// Infof logs an informational message. Arguments are handled in the
	// manner of fmt.Print.
	Infof(format string, v ...interface{})
}

InfoLogger defines an API to use for logging informational messages, which actual logging implementations can implement directly or provide an adapter to use.

type Logger

Logger defines an API to use for logging, which actual logging implementations can implement directly or provide an adapter to use.

type Prefixer

type Prefixer struct {
	Logger Logger
	Prefix string
}

Prefixer adds a prefix to another logger's output.

func (*Prefixer) Debug

func (p *Prefixer) Debug(v ...interface{})

Debug logs a debug message. Arguments are handled in the manner of fmt.Print.

func (*Prefixer) Debugf

func (p *Prefixer) Debugf(format string, v ...interface{})

Debugf logs a debug message. Arguments are handled in the manner of fmt.Printf.

func (*Prefixer) Error

func (p *Prefixer) Error(v ...interface{})

Error logs an error message. Arguments are handled in the manner of fmt.Print.

func (*Prefixer) Errorf

func (p *Prefixer) Errorf(format string, v ...interface{})

Errorf logs an error message. Arguments are handled in the manner of fmt.Printf.

func (*Prefixer) Fatal

func (p *Prefixer) Fatal(status int, v ...interface{})

Fatal logs a fatal error message. Arguments are handled in the manner of fmt.Print.

func (*Prefixer) Fatalf

func (p *Prefixer) Fatalf(status int, format string, v ...interface{})

Fatalf logs a fatal error message. Arguments are handled in the manner of fmt.Printf.

func (*Prefixer) Info

func (p *Prefixer) Info(v ...interface{})

Info logs an informational message. Arguments are handled in the manner of fmt.Print.

func (*Prefixer) Infof

func (p *Prefixer) Infof(format string, v ...interface{})

Infof logs an informational message. Arguments are handled in the manner of fmt.Printf.

func (*Prefixer) Time

func (p *Prefixer) Time(v ...interface{}) Timing

Time starts timing an event and logs an informational message. Arguments are handled in the manner of fmt.Print.

func (*Prefixer) Timef

func (p *Prefixer) Timef(format string, v ...interface{}) Timing

Timef starts timing an event and logs an informational message. Arguments are handled in the manner of fmt.Printf.

func (*Prefixer) Warn

func (p *Prefixer) Warn(v ...interface{})

Warn logs a warning message. Arguments are handled in the manner of fmt.Print.

func (*Prefixer) Warnf

func (p *Prefixer) Warnf(format string, v ...interface{})

Warnf logs a warning message. Arguments are handled in the manner of fmt.Printf.

type Timing

type Timing interface {
	// End finishes timing an event and logs an informational message.
	End() time.Duration
	// EndWithMsg finishes timing an event and logs an informational message.
	// Arguments are handled in the manner of fmt.Print.
	EndWithMsg(v ...interface{}) time.Duration
	// EndWithMsgf finishes timing an event and logs an informational message.
	// Arguments are handled in the manner of fmt.Printf.
	EndWithMsgf(format string, v ...interface{}) time.Duration
}

Timing is used to record the duration between two events. One of End(), EndWithMsg(), or EndWithMsgf() should be called when the event has finished.

type TimingLogger

type TimingLogger interface {
	// Time starts timing an event and logs an informational message.
	// Arguments are handled in the manner of fmt.Print.
	Time(v ...interface{}) Timing
	// Timef starts timing an event and logs an informational message.
	// Arguments are handled in the manner of fmt.Printf.
	Timef(format string, v ...interface{}) Timing
}

TimingLogger defines an API to use for logging timed data, which actual logging implementations can implement directly or provide an adapter to use.

type WarnLogger

type WarnLogger interface {
	// Warn logs a warning message. Arguments are handled in the manner of
	// fmt.Print.
	Warn(v ...interface{})
	// Warnf logs a warning message. Arguments are handled in the manner of
	// fmt.Printf.
	Warnf(format string, v ...interface{})
}

WarnLogger defines an API to use for logging warning messages, which actual logging implementations can implement directly or provide an adapter to use.

Jump to

Keyboard shortcuts

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