log

package
v0.0.0-...-2772968 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ditch

type Ditch struct{}

Ditch ditch all logs

func NewDitch

func NewDitch() Ditch

NewDitch creates a new Ditch

func (Ditch) Context

func (w Ditch) Context(name string, params ...interface{}) Logger

Context build a new Sub context

func (Ditch) Debug

func (w Ditch) Debug(msg string, params ...interface{})

Debug write an debug message

func (Ditch) Error

func (w Ditch) Error(msg string, params ...interface{})

Error write an error message

func (Ditch) Info

func (w Ditch) Info(msg string, params ...interface{})

Info write an info message

func (Ditch) Warning

func (w Ditch) Warning(msg string, params ...interface{})

Warning write an warning message

func (Ditch) Write

func (w Ditch) Write(b []byte) (int, error)

Write writes default error

type Logger

type Logger interface {
	Context(name string, params ...interface{}) Logger
	Write(b []byte) (int, error)
	Info(msg string, params ...interface{})
	Debug(msg string, params ...interface{})
	Warning(msg string, params ...interface{})
	Error(msg string, params ...interface{})
}

Logger represents a logger

func NewDebugOrNonDebugWriter

func NewDebugOrNonDebugWriter(
	useDebug bool, context string, w io.Writer) Logger

NewDebugOrNonDebugWriter creates debug or nondebug log depends on given `useDebug`

type NonDebugWriter

type NonDebugWriter struct {
	Writer
}

NonDebugWriter will write logs to the underlaying writer

func NewNonDebugWriter

func NewNonDebugWriter(context string, w io.Writer) NonDebugWriter

NewNonDebugWriter creates a new Writer with debug output disabled

func (NonDebugWriter) Context

func (w NonDebugWriter) Context(name string, params ...interface{}) Logger

Context build a new Sub context

func (NonDebugWriter) Debug

func (w NonDebugWriter) Debug(msg string, params ...interface{})

Debug ditchs debug operation

type Writer

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

Writer will write logs to the underlaying writer

func NewWriter

func NewWriter(context string, w io.Writer) Writer

NewWriter creates a new Writer

func (Writer) Context

func (w Writer) Context(name string, params ...interface{}) Logger

Context build a new Sub context

func (Writer) Debug

func (w Writer) Debug(msg string, params ...interface{})

Debug write an debug message

func (Writer) Error

func (w Writer) Error(msg string, params ...interface{})

Error write an error message

func (Writer) Info

func (w Writer) Info(msg string, params ...interface{})

Info write an info message

func (Writer) Warning

func (w Writer) Warning(msg string, params ...interface{})

Warning write an warning message

func (Writer) Write

func (w Writer) Write(b []byte) (int, error)

Write writes default error

Jump to

Keyboard shortcuts

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