Documentation ¶
Index ¶
- Constants
- func CapitalLevelEncoder(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
- func FullCallerEncoder(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder)
- func ISO8601TimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
- func NewHertzLog(opts ...Option)
- func NewKitexLog(opts ...Option)
- func NewLumberjackWriteSyncer(fileName string, config *OptionConfig) zapcore.WriteSyncer
- func NewRotateWriteSyncer(fileName string, config *OptionConfig) zapcore.WriteSyncer
- func NewWriteSyncer(fileName string, config *OptionConfig) zapcore.WriteSyncer
- func ShortCallerEncoder(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder)
- func StringDurationEncoder(d time.Duration, enc zapcore.PrimitiveArrayEncoder)
- type Level
- type Option
- func WithCompress(compress bool) Option
- func WithMaxAge(maxAge int) Option
- func WithMaxBackups(maxBackups int) Option
- func WithMaxSize(maxSize int) Option
- func WithOutputMode(outputMode int) Option
- func WithPath(path string) Option
- func WithRotationDuration(rotationDuration time.Duration) Option
- func WithSuffix(suffix string) Option
- type OptionConfig
Constants ¶
View Source
const (
DefaultLogPath = "./log"
)
Variables ¶
This section is empty.
Functions ¶
func CapitalLevelEncoder ¶
func CapitalLevelEncoder(l zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
CapitalLevelEncoder 自定义等级格式
func FullCallerEncoder ¶
func FullCallerEncoder(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder)
func ISO8601TimeEncoder ¶
func ISO8601TimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
ISO8601TimeEncoder 自定义时间格式
func NewHertzLog ¶
func NewHertzLog(opts ...Option)
func NewKitexLog ¶
func NewKitexLog(opts ...Option)
func NewLumberjackWriteSyncer ¶
func NewLumberjackWriteSyncer(fileName string, config *OptionConfig) zapcore.WriteSyncer
func NewRotateWriteSyncer ¶
func NewRotateWriteSyncer(fileName string, config *OptionConfig) zapcore.WriteSyncer
func NewWriteSyncer ¶
func NewWriteSyncer(fileName string, config *OptionConfig) zapcore.WriteSyncer
func ShortCallerEncoder ¶
func ShortCallerEncoder(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder)
func StringDurationEncoder ¶
func StringDurationEncoder(d time.Duration, enc zapcore.PrimitiveArrayEncoder)
StringDurationEncoder 自定义时间格式
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithCompress ¶
func WithMaxAge ¶
func WithMaxBackups ¶
func WithMaxSize ¶
func WithOutputMode ¶
func WithRotationDuration ¶
func WithSuffix ¶
type OptionConfig ¶
type OptionConfig struct {
// contains filtered or unexported fields
}
func DefaultOptionConfig ¶
func DefaultOptionConfig() *OptionConfig
Click to show internal directories.
Click to hide internal directories.