Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConsoleCore ¶
func NewConsoleCore(level zapcore.LevelEnabler) zapcore.Core
NewConsoleCore 构造一个输出到 stdout 的 console encoder core。
设计要点: - 采用 ProductionEncoderConfig,字段与 zap 默认生产格式保持一致 - 通过自定义 EncodeTime/EncodeLevel/EncodeCaller,把输出变成更利于人读的形式 - 返回的 Core 可与 JSON Core 通过 zapcore.NewTee 合并
func NewRemoteCore ¶ added in v0.2.0
func NewRemoteCore(level zapcore.LevelEnabler, handle func(b []byte)) zapcore.Core
NewRemoteCore 构造一个远端输出 core。
该 core 的目标是减少额外编解码:直接在 core.Write 中组装目标 JSON,并调用 handle。
Types ¶
Click to show internal directories.
Click to hide internal directories.