logger

package
v0.0.0-...-fb1cdef Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct {
	Logger
	// contains filtered or unexported fields
}

func New

func New(logger Logger) *Log

func (*Log) Channel

func (log *Log) Channel() chan error

func (*Log) Errorf

func (log *Log) Errorf(format string, args ...interface{})

func (*Log) Infof

func (log *Log) Infof(format string, args ...interface{})

func (*Log) SendErrorf

func (log *Log) SendErrorf(format string, args ...interface{})

SendErrorf - sends error to channel and writes it in log.

func (*Log) SetChannelCapacity

func (log *Log) SetChannelCapacity(capacity int)

func (*Log) Tracef

func (log *Log) Tracef(format string, args ...interface{})

func (*Log) Warningf

func (log *Log) Warningf(format string, args ...interface{})

func (*Log) Writef

func (log *Log) Writef(
	method Method,
	format string,
	args ...interface{},
)

type Logger

type Logger interface {
	Write(string, string, ...interface{})
	Trace(string, ...interface{})
	Info(string, ...interface{})
	Error(string, ...interface{})
	Warning(string, ...interface{})
}

type Method

type Method string
const (
	Trace   Method = "TRACE"
	Info    Method = "INFO"
	Warning Method = "WARN"
	Error   Method = "ERROR"
)

Jump to

Keyboard shortcuts

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