Documentation
¶
Overview ¶
Example ¶
NewBasicLog(os.Stdout, WithNoColor(true), WithDebug(true), WithTimeFormat("2006"))
// zlog.NewJSONLog(os.Stdout)
ZInfo().
Int("z", 100-1).
Msg("just do it")
ZDebug().
Float64("f", 3.1415926).
Msgf("hello %s", "zlog")
Output: 2019 INF example_test.go:11 > just do it z=99 2019 DBG example_test.go:15 > hello zlog f=3.1415926
Index ¶
- Variables
- func Debugf(format string, v ...interface{})
- func NewBasicLog(w io.Writer, opts ...LogOpt)
- func NewJSONLog(w io.Writer, opts ...LogOpt)
- func ZDebug() *zerolog.Event
- func ZError() *zerolog.Event
- func ZFatal() *zerolog.Event
- func ZInfo() *zerolog.Event
- func ZWarn() *zerolog.Event
- type LogOpt
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // TimeFieldFormat time format TimeFieldFormat = time.RFC3339 // TimeFormatUnixNano time format TimeFormatUnixNano = "2006-01-02 15:04:05.999999999" // NoColor if set color NoColor = false )
Functions ¶
Types ¶
type LogOpt ¶ added in v0.1.3
type LogOpt func(o *option)
LogOpt log option
func WithNoColor ¶ added in v0.1.3
WithNoColor set if has color
func WithTimeFormat ¶ added in v0.1.3
WithTimeFormat set time format when basic format
Click to show internal directories.
Click to hide internal directories.
