Documentation ¶
Index ¶
- Constants
- Variables
- func ApiLogger(logLevel int) func(http.Handler) http.Handler
- func ErrTrace(err error, extras ...string)
- func GetLogLevel() int
- func SetLogLevel(newLevel int, outputPath string)
- func ShowErr(err error, extras ...string)
- func TraceCaller(skip int, format string, v ...any)
- type FuncLogger
- type Logger
- type StackError
Constants ¶
View Source
const ( QUIET = -1 DEFAULT = 0 DEBUG = 1 TRACE = 2 )
Variables ¶
View Source
var Error *log.Logger
View Source
var Info *log.Logger
View Source
var Output *os.File
View Source
var Warning *log.Logger
Functions ¶
func GetLogLevel ¶
func GetLogLevel() int
func SetLogLevel ¶
func TraceCaller ¶
Types ¶
type FuncLogger ¶
type FuncLogger interface { Logger // Func allows for a logger callback, that can be optionally disabled based on the log level. // This way, expensive logging operations can be avoided if the log level is too low by putting them // inside the function. Func(func(Logger)) }
var Debug FuncLogger = emptyLogger{}
var Trace FuncLogger = emptyLogger{}
type Logger ¶
type Logger interface { Printf(format string, v ...any) Println(v ...any) Printfn(skip int, format string, v ...any) Printlnn(skip int, v ...any) }
var ErrorCatcher Logger
type StackError ¶
Click to show internal directories.
Click to hide internal directories.