Documentation ¶
Index ¶
- Variables
- func FromL(l L.L) *zap.SugaredLogger
- func New(cfg Config, f func(*zap.Config), zopts []zap.Option) (*zap.SugaredLogger, error)
- func Z(z *zap.SugaredLogger) *zap.SugaredLogger
- type ApacheLogWriter
- type Config
- type ZL
- func (zl *ZL) DPanic(s string, args ...interface{})
- func (zl *ZL) DPanicf(s string, args ...interface{})
- func (zl *ZL) Debug(s string, args ...interface{})
- func (zl *ZL) Debugf(s string, args ...interface{})
- func (zl *ZL) Error(s string, args ...interface{})
- func (zl *ZL) Errorf(s string, args ...interface{})
- func (zl *ZL) Fatal(s string, args ...interface{})
- func (zl *ZL) Fatalf(s string, args ...interface{})
- func (zl *ZL) Info(s string, args ...interface{})
- func (zl *ZL) Infof(s string, args ...interface{})
- func (zl *ZL) Named(n string) L.L
- func (zl *ZL) Panic(s string, args ...interface{})
- func (zl *ZL) Panicf(s string, args ...interface{})
- func (zl *ZL) SkipCaller(i int) L.L
- func (zl *ZL) Warn(s string, args ...interface{})
- func (zl *ZL) Warnf(s string, args ...interface{})
- func (zl *ZL) With(vs ...interface{}) L.L
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultOpts = []zap.Option{ zap.AddCaller(), }
Functions ¶
func Z ¶
func Z(z *zap.SugaredLogger) *zap.SugaredLogger
If z is nil, nop logger is returned. Otherwise z is returned.
Types ¶
type ApacheLogWriter ¶
type ApacheLogWriter struct { Z *zap.SugaredLogger // True will report regular access as Info, False as Debug. InfoLevel bool }
ApacheLogWriter implements an io.Writer interface to be used as a sink for logging.
type Config ¶
type Config struct { // Minimal log level to be emitted. Level string `envconfig:"LEVEL" default:"info" json:"level"` // Dev determines log output format. True for human readable (appropiate // for console output), and False for machine readable (appropiate for // automated consumption as a JSON blob). Dev bool `envconfig:"DEV" default:"true" json:"dev"` ErrorStackTrace bool }
Zap logger configuration.
type ZL ¶
type ZL struct{ Z *zap.SugaredLogger }
Click to show internal directories.
Click to hide internal directories.