logadapter

package
v1.103.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 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 deprecated

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

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

Deprecated: Use slog instead. August 28, 2023

type Discarder deprecated

type Discarder struct{}

Discarder discards all data given to it.

Deprecated: Use slog instead. August 28, 2023

func (*Discarder) Debug deprecated

func (d *Discarder) Debug(_ ...any)

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

Deprecated: Use slog instead. August 28, 2023

func (*Discarder) Debugf deprecated

func (d *Discarder) Debugf(_ string, _ ...any)

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

Deprecated: Use slog instead. August 28, 2023

func (*Discarder) Error deprecated

func (d *Discarder) Error(_ ...any)

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

Deprecated: Use slog instead. August 28, 2023

func (*Discarder) Errorf deprecated

func (d *Discarder) Errorf(_ string, _ ...any)

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

Deprecated: Use slog instead. August 28, 2023

func (*Discarder) Fatal deprecated

func (d *Discarder) Fatal(status int, _ ...any)

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

Deprecated: Use slog instead. August 28, 2023

func (*Discarder) Fatalf deprecated

func (d *Discarder) Fatalf(status int, _ string, _ ...any)

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

Deprecated: Use slog instead. August 28, 2023

func (*Discarder) Info deprecated

func (d *Discarder) Info(_ ...any)

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

Deprecated: Use slog instead. August 28, 2023

func (*Discarder) Infof deprecated

func (d *Discarder) Infof(_ string, _ ...any)

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

Deprecated: Use slog instead. August 28, 2023

func (*Discarder) Time deprecated

func (d *Discarder) Time(_ ...any) Timing

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

Deprecated: Use slog instead. August 28, 2023

func (*Discarder) Timef deprecated

func (d *Discarder) Timef(_ string, _ ...any) Timing

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

Deprecated: Use slog instead. August 28, 2023

func (*Discarder) Warn deprecated

func (d *Discarder) Warn(_ ...any)

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

Deprecated: Use slog instead. August 28, 2023

func (*Discarder) Warnf deprecated

func (d *Discarder) Warnf(_ string, _ ...any)

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

Deprecated: Use slog instead. August 28, 2023

type ErrorLogger deprecated

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

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

Deprecated: Use slog instead. August 28, 2023

type FatalLogger deprecated

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 ...any)
	// 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 ...any)
}

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

Deprecated: Use slog instead. August 28, 2023

type InfoLogger deprecated

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

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

Deprecated: Use slog instead. August 28, 2023

type Logger deprecated

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

Deprecated: Use slog instead. August 28, 2023

type Prefixer deprecated

type Prefixer struct {
	Logger Logger
	Prefix string
}

Prefixer adds a prefix to another logger's output.

Deprecated: Use slog instead. August 28, 2023

func (*Prefixer) Debug deprecated

func (p *Prefixer) Debug(v ...any)

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

Deprecated: Use slog instead. August 28, 2023

func (*Prefixer) Debugf deprecated

func (p *Prefixer) Debugf(format string, v ...any)

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

Deprecated: Use slog instead. August 28, 2023

func (*Prefixer) Error deprecated

func (p *Prefixer) Error(v ...any)

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

Deprecated: Use slog instead. August 28, 2023

func (*Prefixer) Errorf deprecated

func (p *Prefixer) Errorf(format string, v ...any)

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

Deprecated: Use slog instead. August 28, 2023

func (*Prefixer) Fatal deprecated

func (p *Prefixer) Fatal(status int, v ...any)

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

Deprecated: Use slog instead. August 28, 2023

func (*Prefixer) Fatalf deprecated

func (p *Prefixer) Fatalf(status int, format string, v ...any)

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

Deprecated: Use slog instead. August 28, 2023

func (*Prefixer) Info deprecated

func (p *Prefixer) Info(v ...any)

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

Deprecated: Use slog instead. August 28, 2023

func (*Prefixer) Infof deprecated

func (p *Prefixer) Infof(format string, v ...any)

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

Deprecated: Use slog instead. August 28, 2023

func (*Prefixer) Time deprecated

func (p *Prefixer) Time(v ...any) Timing

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

Deprecated: Use slog instead. August 28, 2023

func (*Prefixer) Timef deprecated

func (p *Prefixer) Timef(format string, v ...any) Timing

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

Deprecated: Use slog instead. August 28, 2023

func (*Prefixer) Warn deprecated

func (p *Prefixer) Warn(v ...any)

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

Deprecated: Use slog instead. August 28, 2023

func (*Prefixer) Warnf deprecated

func (p *Prefixer) Warnf(format string, v ...any)

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

Deprecated: Use slog instead. August 28, 2023

type Timing deprecated

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 ...any) 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 ...any) 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.

Deprecated: Use slog instead. August 28, 2023

type TimingLogger deprecated

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

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

Deprecated: Use slog instead. August 28, 2023

type WarnLogger deprecated

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

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

Deprecated: Use slog instead. August 28, 2023

Jump to

Keyboard shortcuts

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