log

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Write(entry *Entry) error
	NotifyAboutSender(sender string)
	NotifyAboutSeverity(severity *Severity)
	Shutdown()
	SetGate(gate uint)
}

type CommonBackend

type CommonBackend struct {
	Gate uint
}

func (*CommonBackend) SetGate

func (back *CommonBackend) SetGate(gate uint)

type Entry

type Entry struct {
	Time     time.Time
	Severity *Severity
	Message  string
	Sender   string
}

type Loggee

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

func (*Loggee) AddBackend

func (l *Loggee) AddBackend(backend Backend)

func (*Loggee) Log

func (l *Loggee) Log(entry *Entry) error

func (*Loggee) NotifyAboutDefaults

func (l *Loggee) NotifyAboutDefaults()

func (*Loggee) NotifyAboutSenders

func (l *Loggee) NotifyAboutSenders(senders ...string)

func (*Loggee) NotifyAboutSeverities

func (l *Loggee) NotifyAboutSeverities(severities ...*Severity)

func (*Loggee) SetGate

func (l *Loggee) SetGate(gate uint)

func (*Loggee) Shutdown

func (l *Loggee) Shutdown()

type Severity

type Severity struct {
	Representation string
	Index          uint
	Fatal          bool
}
var (
	DEBUG Severity = Severity{
		Representation: "DEBUG",
		Index:          0,
		Fatal:          false,
	}
	TRACE Severity = Severity{
		Representation: "TRACE",
		Index:          10,
		Fatal:          false,
	}
	INFO Severity = Severity{
		Representation: "INFO",
		Index:          20,
		Fatal:          false,
	}
	WARNING Severity = Severity{
		Representation: "WARNING",
		Index:          30,
		Fatal:          false,
	}
	ERROR Severity = Severity{
		Representation: "ERROR",
		Index:          40,
		Fatal:          true,
	}
)

func (*Severity) Announce

func (severity *Severity) Announce(back Backend)

Directories

Path Synopsis
backends

Jump to

Keyboard shortcuts

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