lg

package
v0.0.0-...-48a15a0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: 0BSD Imports: 3 Imported by: 0

Documentation

Overview

lg is a wrapper of builtin log package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func D

func D(_ any, e error)

func D0

func D0(e error)

func Debug

func Debug(v ...interface{})

func Debugf

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

func EnableColor

func EnableColor()

func Error

func Error(v ...interface{})

func Errorf

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

func Fatal

func Fatal(v ...interface{})

func Fatalf

func Fatalf(format string, v ...interface{})

func I

func I(_ any, e error)

func I0

func I0(e error)

func Info

func Info(v ...interface{})

func Infof

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

func Panic

func Panic(v ...interface{})

func Panicf

func Panicf(format string, v ...interface{})

func PrependLevel

func PrependLevel(lv Level, s string) string

func T

func T(_ any, e error)

func T0

func T0(e error)

func Trace

func Trace(v ...interface{})

func Tracef

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

func W

func W(_ any, e error)

func W0

func W0(_ any, e error)

func Warning

func Warning(v ...interface{})

func Warningf

func Warningf(format string, v ...interface{})

Types

type Level

type Level int
const (
	LvFatal Level = iota
	LvPanic
	LvError
	LvWarning
	LvInfo
	LvTrace
	LvDebug
)
var MinimalLevel Level = LvInfo

type Logger

type Logger func(depth int, lv Level, str string)
var Backend Logger = func(depth int, lv Level, str string) {
	msg := PrependLevel(lv, str)
	log.Output(depth+1, msg)
}

Jump to

Keyboard shortcuts

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