Documentation
¶
Index ¶
- Variables
- func CallerFile(l *Logger)
- func CallerFunc(l *Logger)
- func Debug(l *Logger)
- func Fatalf(format string, args ...interface{})
- func LevelBraces(l *Logger)
- func Msec(l *Logger)
- func Print(line string)
- func Printf(format string, args ...interface{})
- func Setup(opts ...Option)
- type Func
- type L
- type Logger
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var NoOp = Func(func(format string, args ...interface{}) {})
NoOp logger
View Source
var Std = Func(func(format string, args ...interface{}) { stdlog.Printf(format, args...) })
Std logger sends to std default logger directly
Functions ¶
func CallerFile ¶ added in v0.1.4
func CallerFile(l *Logger)
CallerFile adds caller info with file, and line number
func CallerFunc ¶ added in v0.1.4
func CallerFunc(l *Logger)
CallerFunc adds caller info with function name
func Fatalf ¶ added in v0.2.0
func Fatalf(format string, args ...interface{})
Fatalf simplifies replacement of std logger
Types ¶
type Func ¶
type Func func(format string, args ...interface{})
Func type is an adapter to allow the use of ordinary functions as Logger.
type L ¶
type L interface {
Logf(format string, args ...interface{})
}
L defines minimal interface used to log things
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger provided simple logger with basic support of levels. Thread safe
func New ¶
New makes new leveled logger. Accepts dbg flag turing on info about the caller and allowing DEBUG messages/ Two writers can be passed optionally - first for out and second for err
Click to show internal directories.
Click to hide internal directories.