Documentation ¶
Overview ¶
Package log redirects output from the standard library's package-global logger to the wrapped zap logger at InfoLevel. It also has a predefined 'standard' Logger accessible through helper functions Print[f|ln], Fatal[f|ln], and Panic[f|ln], which are easier to use than creating a Logger manually.
Index ¶
- func Err(err error) zapcore.Field
- func Error(msg string, fields ...zapcore.Field)
- func Fatal(args ...interface{})
- func Fatalf(template string, args ...interface{})
- func Fatalln(args ...interface{})
- func Info(msg string, fields ...zapcore.Field)
- func NewDevelopment() *zap.Logger
- func NewProduction() *zap.Logger
- func Panic(args ...interface{})
- func Panicf(template string, args ...interface{})
- func Panicln(args ...interface{})
- func Print(args ...interface{})
- func Printf(template string, args ...interface{})
- func Println(args ...interface{})
- func ReplaceGlobals(l *zap.Logger)
- func StdLogger() (l *log.Logger)
- func Sync() error
- func Warn(msg string, fields ...zapcore.Field)
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Error ¶
Error logs a message at ErrorLevel. The message includes any fields passed at the log site, as well as any fields accumulated on the logger.
func Fatal ¶
func Fatal(args ...interface{})
Fatal is equivalent to Print() followed by a call to os.Exit(1).
func Fatalf ¶
func Fatalf(template string, args ...interface{})
Fatalf is equivalent to Printf() followed by a call to os.Exit(1).
func Fatalln ¶
func Fatalln(args ...interface{})
Fatalln is equivalent to Println() followed by a call to os.Exit(1).
func Info ¶
Info logs a message at InfoLevel. The message includes any fields passed at the log site, as well as any fields accumulated on the logger.
func NewDevelopment ¶
NewDevelopment creates logger for development
func Panic ¶
func Panic(args ...interface{})
Panic is equivalent to Print() followed by a call to panic().
func Panicf ¶
func Panicf(template string, args ...interface{})
Panicf is equivalent to Printf() followed by a call to panic().
func Panicln ¶
func Panicln(args ...interface{})
Panicln is equivalent to Println() followed by a call to panic().
func Print ¶
func Print(args ...interface{})
Print calls log.Output to print to the logger. Arguments are handled in the manner of fmt.Printf.
func Printf ¶
func Printf(template string, args ...interface{})
Printf calls log.Output to print to the logger. Arguments are handled in the manner of fmt.Printf.
func Println ¶
func Println(args ...interface{})
Println calls log.Output to print to the logger. Arguments are handled in the manner of fmt.Println.
func StdLogger ¶
StdLogger returns a *log.Logger which writes to the underlying logger at InfoLevel.