Documentation ¶
Overview ¶
@Title log capability of zerolog @Description zerolog implementation of log capability @Author Ryan Fan 2021-06-09 @Update Ryan Fan 2021-06-09
Index ¶
- Constants
- Variables
- type ConfigLog
- type RotateLogConf
- type ZerologProvider
- func (c *ZerologProvider) Debug(msg string, keyvals ...interface{})
- func (c *ZerologProvider) Error(msg string, keyvals ...interface{})
- func (c *ZerologProvider) Fatal(msg string, keyvals ...interface{})
- func (c *ZerologProvider) GetStdLogger() *stdlog.Logger
- func (c *ZerologProvider) Info(msg string, keyvals ...interface{})
- func (c *ZerologProvider) Init(rootConfiger types.Configer, logger types.LogProvider, args ...interface{}) error
- func (c *ZerologProvider) Log(keyvals ...interface{}) error
- func (c *ZerologProvider) Panic(msg string, keyvals ...interface{})
- func (c *ZerologProvider) Trace(msg string, keyvals ...interface{})
- func (c *ZerologProvider) Warn(msg string, keyvals ...interface{})
Constants ¶
View Source
const ( DEFAULT_BASE_DIR = "/var/log" DEFAULT_DIRNAME = "logs" )
View Source
const (
DEFAULT_CALLER_SKIP_FRAME_COUNT = 1
)
缺省的忽略帧数目
View Source
const (
DEFAULT_LINUX_BASE_DIR = "/var/log"
)
Variables ¶
View Source
var (
ErrKeyName = "err"
)
Functions ¶
This section is empty.
Types ¶
type ConfigLog ¶
type ConfigLog struct { Rotate *RotateLogConf `mapstructure:"rotate"` // 日志文件截断的设置 Filename string `mapstructure:"filename"` // 日志文件名 Level string `mapstructure:"level"` // 默认日志级别 }
type RotateLogConf ¶
type ZerologProvider ¶
type ZerologProvider struct{}
func (*ZerologProvider) Debug ¶
func (c *ZerologProvider) Debug(msg string, keyvals ...interface{})
func (*ZerologProvider) Error ¶
func (c *ZerologProvider) Error(msg string, keyvals ...interface{})
func (*ZerologProvider) Fatal ¶
func (c *ZerologProvider) Fatal(msg string, keyvals ...interface{})
func (*ZerologProvider) GetStdLogger ¶
func (c *ZerologProvider) GetStdLogger() *stdlog.Logger
func (*ZerologProvider) Info ¶
func (c *ZerologProvider) Info(msg string, keyvals ...interface{})
func (*ZerologProvider) Init ¶
func (c *ZerologProvider) Init(rootConfiger types.Configer, logger types.LogProvider, args ...interface{}) error
Init implements types.Provider interface, used to initialize the capability @author Ryan Fan (2021-06-09) @param baseconf.Configer root config interface to extract config info @return error
func (*ZerologProvider) Log ¶
func (c *ZerologProvider) Log(keyvals ...interface{}) error
func (*ZerologProvider) Panic ¶
func (c *ZerologProvider) Panic(msg string, keyvals ...interface{})
func (*ZerologProvider) Trace ¶
func (c *ZerologProvider) Trace(msg string, keyvals ...interface{})
func (*ZerologProvider) Warn ¶
func (c *ZerologProvider) Warn(msg string, keyvals ...interface{})
Click to show internal directories.
Click to hide internal directories.