Documentation ¶
Overview ¶
Package log provides uniform logging and tracing interfaces for ntt. Other logging backends like Prometheus are hopefully easy to drop in.
Note this package provides a reduced set of log-levels. Especially Warning, Error, Fatal, Panic functions are missing:
- Warning: Nobody reads warnings, because by definition nothing went wrong.
- Error: If you choose to handle the error by logging it, by definition it’s not an error any more — you handled it. The act of logging an error handles the error, hence it is no longer appropriate to log it as an error.
- Fatal/Panic: It is commonly accepted that libraries should not use panic, but if calling log.Fatal has the same effect, surely this should also be outlawed.
Taken from https://dave.cheney.net/2015/11/05/lets-talk-about-logging
Index ¶
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Debugln(v ...interface{})
- func Print(v ...interface{})
- func Printf(format string, v ...interface{})
- func Println(v ...interface{})
- func SetGlobalLevel(level Level)
- func SetGlobalLogger(l Logger)
- func Trace(v ...interface{})
- func Tracef(format string, v ...interface{})
- func Traceln(v ...interface{})
- func Verbose(v ...interface{})
- func Verbosef(format string, v ...interface{})
- func Verboseln(v ...interface{})
- type ConsoleLogger
- type ConsoleTracer
- type Level
- type Logger
- type Span
- type Tracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetGlobalLevel ¶
func SetGlobalLevel(level Level)
func SetGlobalLogger ¶
func SetGlobalLogger(l Logger)
Types ¶
type ConsoleLogger ¶
type ConsoleTracer ¶
type ConsoleTracer struct {
// contains filtered or unexported fields
}
func (ConsoleTracer) End ¶
func (t ConsoleTracer) End()
Click to show internal directories.
Click to hide internal directories.