logger

package module
v0.0.0-...-19d94ac Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: MIT Imports: 12 Imported by: 4

README

logger

A FAIRE.

Licence

MIT.


Copyright (c) 2021 mls-361.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All() map[string]string

All AFAIRE.

func SetLevel

func SetLevel(id string, level string) error

SetLevel AFAIRE.

Types

type Level

type Level uint32

Level AFAIRE.

const (
	// LevelTrace AFAIRE.
	LevelTrace Level = 1

	// LevelDebug AFAIRE.
	LevelDebug Level = 2

	// LevelInfo AFAIRE.
	LevelInfo Level = 3

	// LevelNotice AFAIRE.
	LevelNotice Level = 4

	// LevelWarning AFAIRE.
	LevelWarning Level = 5

	// LevelError AFAIRE.
	LevelError Level = 6

	// LevelFatal AFAIRE.
	LevelFatal Level = 7
)

func StringToLevel

func StringToLevel(level string) Level

StringToLevel AFAIRE.

func (Level) String

func (l Level) String() string

String AFAIRE.

type Logger

type Logger interface {
	ID() string
	SetLevel(level string)
	NewLogger(id string, name string) Logger
	Remove()
	Write(level Level, msg string, kv ...interface{})
	Trace(msg string, kv ...interface{})
	Debug(msg string, kv ...interface{})
	Info(msg string, kv ...interface{})
	Notice(msg string, kv ...interface{})
	Warning(msg string, kv ...interface{})
	Error(msg string, kv ...interface{})
	Fatal(msg string, kv ...interface{})
	NewStdLogger(level, prefix string, flag int) *log.Logger
	Close() error
}

Logger AFAIRE.

func New

func New(id string, name, level string, output Output) (Logger, error)

New AFAIRE.

type Output

type Output interface {
	Write(id string, name string, level Level, msg string, kv ...interface{}) error
	Close() error
}

Output AFAIRE.

func NewStderrOutput

func NewStderrOutput() Output

NewStderrOutput AFAIRE.

func NewSyslogOutput

func NewSyslogOutput(facility, app string) (Output, error)

NewSyslogOutput AFAIRE.

Jump to

Keyboard shortcuts

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