Versions in this module Expand all Collapse all v0 v0.1.3 Sep 13, 2020 Changes in this version + type Logger struct + func (logger *Logger) Debug(msg string, args ...zap.Field) + func (logger *Logger) Debugf(format string, args ...interface{}) + func (logger *Logger) Error(msg string, args ...zap.Field) + func (logger *Logger) Errorf(format string, args ...interface{}) + func (logger *Logger) Fatal(msg string, args ...zap.Field) + func (logger *Logger) Fatalf(format string, args ...interface{}) + func (logger *Logger) Info(msg string, args ...zap.Field) + func (logger *Logger) Infof(format string, args ...interface{}) + func (logger *Logger) Sync() error + func (logger *Logger) Warn(msg string, args ...zap.Field) + func (logger *Logger) Warnf(format string, args ...interface{}) + func (logger *Logger) With(k string, v interface{}) zap.Field + func (logger *Logger) WithError(err error) zap.Field v0.1.1 Apr 12, 2020 Changes in this version + const BYTE + const EncodeConsole + const EncodeJson + const FullCaller + const GIGABYTE + const KILOBYTE + const LevelCapital + const LevelLower + const MEGABYTE + const NoCaller + const RotateByDate + const RotateBySize + const RotateIntervalDay + const RotateIntervalHour + const RotateIntervalMinute + const RotateIntervalMonth + const RotateIntervalYear + const ShortCaller + const TERABYTE + const WriteLevel + const WriteSingle + var ErrorInvalidByteQuantity = fmt.Errorf(...) + var ErrorInvalidSize = fmt.Errorf("value is greater than 1024") + func GetFileSuffix(filepath string, suffix string) string + func Init(opts ...LogOption) *logger + func InitByOptions(l *LogOptions) *logger + func SizeToBytes(s string) (int, error) + type CallerType int + type KeyOptions struct + CallerKey string + LevelKey string + MessageKey string + NameKey string + StacktraceKey string + TimeKey string + type LevelEncoderType int + type LogEncodeType string + type LogOption func(*LogOptions) + func CallerKey(key string) LogOption + func DefaultOptions(logPath string) []LogOption + func LevelKey(key string) LogOption + func NameKey(key string) LogOption + func SetCaller(caller CallerType) LogOption + func SetCompress(compress bool) LogOption + func SetHiddenDisplay(hiddenDisplay bool) LogOption + func SetLevelEncoder(encoder LevelEncoderType) LogOption + func SetLogEncoder(encoder LogEncodeType) LogOption + func SetLogLevel(logLevel string) LogOption + func SetLogPath(path string) LogOption + func SetMaxAge(maxAge int) LogOption + func SetMaxBackups(maxBackups int) LogOption + func SetMaxSize(maxSize int) LogOption + func SetMessageKey(key string) LogOption + func SetRotateBy(rotateType RotateType) LogOption + func SetRotateInterval(rotateInterval RotateInterval) LogOption + func SetStackTrace(stackTrace bool) LogOption + func SetTimeEncoderLayout(layout string) LogOption + func SetWriteBy(writeType WriteType) LogOption + func StacktraceKey(key string) LogOption + func TimeKey(key string) LogOption + type LogOptions struct + Caller CallerType + Compress bool + HiddenDisplay bool + Keys KeyOptions + LevelEncoder LevelEncoderType + LogEncoder LogEncodeType + LogLevel zapcore.Level + LogPath string + MaxAge int + MaxBackups int + MaxSize int + RotateBy RotateType + RotateInterval RotateInterval + StackTrace bool + TimeEncoderLayout string + WriteBy WriteType + type RotateInterval string + func (t RotateInterval) Format() string + func (t RotateInterval) RotationGap() time.Duration + type RotateType int + type WriteType int