log

package
v0.0.0-...-46f88e6 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Llongfile modifies the logger output to include full path and line number
	// of the logging callsite, e.g. /a/b/c/main.go:123.
	Llongfile uint32 = 1 << iota

	// Lshortfile modifies the logger output to include filename and line number
	// of the logging callsite, e.g. main.go:123.  Overrides Llongfile.
	Lshortfile

	Lcolor

	Llongdate
)

Flags to modify Backend's behavior.

View Source
const (
	Reset  = "\x1b[0m"
	Bright = "\x1b[1m"

	FgGreen = "\x1b[32m"

	FgMagenta = "\x1b[35m"

	BgGreen = "\x1b[42m"
)

Variables

This section is empty.

Functions

func Address

func Address(addr string) string

func BgYellow

func BgYellow(str string) string

func C

func C(c func() string) logClosure

log.C returns a new closure over a function that returns a string which itself provides a Stringer interface so that it can be used with the logging system.

func Coins

func Coins(amount float64) string

func Critical

func Critical(args ...interface{})

func Criticalf

func Criticalf(format string, args ...interface{})

func Debug

func Debug(args ...interface{})

func Debugf

func Debugf(format string, args ...interface{})

func Error

func Error(args ...interface{})

func Errorf

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

func GreenBg

func GreenBg(str string) string

func Height

func Height(h int32) string

func Info

func Info(args ...interface{})

func Infof

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

func Int

func Int(num int) string

func IpAddr

func IpAddr(addr string) string

func SetLogLevels

func SetLogLevels(debugLevel string) er.R

SetLogLevels attempts to parse the specified debug level and set the levels accordingly. An appropriate error is returned if anything is invalid.

func Trace

func Trace(args ...interface{})

func Tracef

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

func Txid

func Txid(str string) string

func Warn

func Warn(args ...interface{})

func WarnIfPrerelease

func WarnIfPrerelease()

func Warnf

func Warnf(format string, args ...interface{})

Types

type Level

type Level uint32

Level is the level at which a logger is configured. All messages sent to a level which is below the current level are filtered.

const (
	LevelTrace Level = iota
	LevelDebug
	LevelInfo
	LevelWarn
	LevelError
	LevelCritical
	LevelOff
	LevelInvalid
)

Level constants.

func LevelFromString

func LevelFromString(s string) (l Level, ok bool)

LevelFromString returns a level based on the input string s. If the input can't be interpreted as a valid log level, the info level and false is returned.

func (Level) String

func (l Level) String() string

String returns the tag of the logger used in log messages, or "OFF" if the level will not produce any log output.

Jump to

Keyboard shortcuts

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