bufferadapter

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter is a logger.Adapter that writes logs to the provided LogEntries slice.

This adapter is designed for testing purposes and is not intended for production use.

func New

func New(buff *LogEntries) *Adapter

New creates a new Adapter instance.

func (*Adapter) Flush

func (*Adapter) Flush() error

func (*Adapter) Log

func (a *Adapter) Log(level int, msg string, err error, fs ...fields.Field)

func (*Adapter) WithFields

func (a *Adapter) WithFields(fs ...fields.Field) logger.Adapter

func (*Adapter) WithName

func (a *Adapter) WithName(name string) logger.Adapter

func (*Adapter) WithStackTrace

func (a *Adapter) WithStackTrace(_ string) logger.Adapter

type LogEntries

type LogEntries []LogEntry

func (*LogEntries) Reset

func (le *LogEntries) Reset()

type LogEntry

type LogEntry struct {
	LoggerName string `exhaustruct:"optional"`
	Level      int
	Msg        string
	Error      error       `exhaustruct:"optional"`
	Fields     fields.List `exhaustruct:"optional"`
}

Jump to

Keyboard shortcuts

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