log

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 License: MIT Imports: 6 Imported by: 4

README

log

GoDev Build Status Coverage Status Go Report Card

A golang library providing a lightweight logging facade.

see rustlang log package

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(loggers Loggers)

func Log

func Log(any logger, l Level, msg string)

func LogFn

func LogFn(any logger, l Level) func(string, ...interface{})

func LogStd

func LogStd(l Level, msg string, a ...interface{})

func LogToDiscard added in v0.0.3

func LogToDiscard(msg string, a ...interface{})

func Logf

func Logf(any logger, l Level, msg string, a ...interface{})

func LogfStd

func LogfStd(l Level, msg string, a ...interface{})

Types

type FnT

type FnT func(Level, string, ...interface{})

func (FnT) Log added in v0.0.6

func (f FnT) Log(l Level, msg string, a ...interface{})

type FnTShrt

type FnTShrt func(Level, string)

type Level

type Level uint8
const (
	/// A special log level used to turn off logging.
	Quiet Level = iota

	// For pervasive information on states of all elementary constructs.
	// Use 'Trace' for in-depth debugging to find problem parts of a function,
	// to check values of temporary variables, etc.
	Trace

	// For detailed system behavior reports and diagnostic messages
	// to help to locate problems during development.
	Debug

	// For general information on the application's work.
	// Use 'Info' level in your code so that you could leave it
	// 'enabled' even in production. So it is a 'production log level'.
	Info

	// For indicating small errors, strange situations,
	// failures that are automatically handled in a safe manner.
	Warn

	// For severe failures that affects application's workflow,
	// not fatal, however (without forcing app shutdown).
	Error

	// For producing final messages before application’s death.
	Critical
)

func NewLevel

func NewLevel(v string) Level

func (Level) MarshalYAML

func (l Level) MarshalYAML() (interface{}, error)

func (Level) String

func (l Level) String() string

func (*Level) UnmarshalYAML

func (l *Level) UnmarshalYAML(unmarshal func(interface{}) error) error

type Logger added in v0.0.4

type Logger interface {
	Log(Level, string, ...interface{})
}

type Loggers

type Loggers interface {
	ByName(string) interface{}
}

logger storage

Jump to

Keyboard shortcuts

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