lg

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package lg provides leveled logging

Index

Constants

View Source
const (
	DEBUG = LogLevel(1)
	INFO  = LogLevel(2)
	WARN  = LogLevel(3)
	ERROR = LogLevel(4)
	FATAL = LogLevel(5)
)

Variables

This section is empty.

Functions

func LogFatal added in v1.2.0

func LogFatal(prefix string, f string, args ...interface{})

func Logf

func Logf(logger Logger, cfgLevel LogLevel, msgLevel LogLevel, f string, args ...interface{})

Types

type AppLogFunc

type AppLogFunc func(lvl LogLevel, f string, args ...interface{})

type LogLevel

type LogLevel int

func ParseLogLevel

func ParseLogLevel(levelstr string) (LogLevel, error)

func (*LogLevel) Get added in v1.2.0

func (l *LogLevel) Get() interface{}

func (*LogLevel) Set added in v1.2.0

func (l *LogLevel) Set(s string) error

func (*LogLevel) String

func (l *LogLevel) String() string

type Logger

type Logger interface {
	Output(maxdepth int, s string) error
}

type NilLogger

type NilLogger struct{}

func (NilLogger) Output

func (l NilLogger) Output(maxdepth int, s string) error

Jump to

Keyboard shortcuts

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