Documentation ¶
Index ¶
- Constants
- func Debug(args ...interface{})
- func Debugf(template string, args ...interface{})
- func Debugw(msg string, keysValues ...interface{})
- func Error(args ...interface{})
- func Errorf(template string, args ...interface{})
- func Errorw(msg string, keysValues ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(template string, args ...interface{})
- func Fatalw(msg string, keysValues ...interface{})
- func Info(args ...interface{})
- func Infof(template string, args ...interface{})
- func Infow(msg string, keysValues ...interface{})
- func Initialize(environment string)
- func NewProductionConfig() zap.Config
- func NewProductionEncoderConfig() zapcore.EncoderConfig
- func Panic(args ...interface{})
- func Panicf(template string, args ...interface{})
- func Panicw(msg string, keysValues ...interface{})
- func Warn(args ...interface{})
- func Warnf(template string, args ...interface{})
- func Warnw(msg string, keysValues ...interface{})
- func WithLogger(_logger Logger)
- type Logger
Constants ¶
const (
ProductionEnvName = "production"
)
Logger constants
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(template string, args ...interface{})
Debugf uses fmt.Sprintf to log a templated message
func Debugw ¶
func Debugw(msg string, keysValues ...interface{})
Debugw logs a message with some additional context. The variadic key-value pairs are treated as they are in With
func Errorf ¶
func Errorf(template string, args ...interface{})
Errorf uses fmt.Sprintf to log a templated message
func Errorw ¶
func Errorw(msg string, keysValues ...interface{})
Errorw logs a message with some additional context. The variadic key-value pairs are treated as they are in With.
func Fatal ¶
func Fatal(args ...interface{})
Fatal uses fmt.Sprint to construct and log a message, then calls os.Exit
func Fatalf ¶
func Fatalf(template string, args ...interface{})
Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit
func Fatalw ¶
func Fatalw(msg string, keysValues ...interface{})
Fatalw logs a message with some additional context, then calls os.Exit. The variadic key-value pairs are treated as they are in With
func Infof ¶
func Infof(template string, args ...interface{})
Infof uses fmt.Sprintf to log a templated message
func Infow ¶
func Infow(msg string, keysValues ...interface{})
Infow logs a message with some additional context. The variadic key-value pairs are treated as they are in With.
func Initialize ¶
func Initialize(environment string)
Initialize default production is false if not call func
func NewProductionConfig ¶
NewProductionConfig is a reasonable production logging configuration. Logging is enabled at InfoLevel and above.
It uses a CONSOLE encoder, writes to standard error, and enables sampling. Stacktraces are automatically included on logs of ErrorLevel and above.
func NewProductionEncoderConfig ¶
func NewProductionEncoderConfig() zapcore.EncoderConfig
NewProductionEncoderConfig returns an opinionated EncoderConfig for production environments.
func Panic ¶
func Panic(args ...interface{})
Panic uses fmt.Sprint to construct and log a message, then panics
func Panicf ¶
func Panicf(template string, args ...interface{})
Panicf uses fmt.Sprintf to log a templated message, then panics
func Panicw ¶
func Panicw(msg string, keysValues ...interface{})
Panicw logs a message with some additional context, then panics. The variadic key-value pairs are treated as they are in With
func Warnf ¶
func Warnf(template string, args ...interface{})
Warnf uses fmt.Sprintf to log a templated message
Types ¶
type Logger ¶
type Logger interface { Debug(args ...interface{}) Debugf(template string, args ...interface{}) Debugw(msg string, keysValues ...interface{}) Info(args ...interface{}) Infof(template string, args ...interface{}) Infow(msg string, keysValues ...interface{}) Warn(args ...interface{}) Warnf(template string, args ...interface{}) Warnw(msg string, keysValues ...interface{}) Error(args ...interface{}) Errorf(template string, args ...interface{}) Errorw(msg string, keysValues ...interface{}) Panic(args ...interface{}) Panicf(template string, args ...interface{}) Panicw(msg string, keysValues ...interface{}) Fatal(args ...interface{}) Fatalf(template string, args ...interface{}) Fatalw(msg string, keysValues ...interface{}) }
Logger interface