Documentation ¶
Overview ¶
Package logger Date: 2022/12/15 23:18:03 Author: Amu Description:
Package logger Date: 2022/12/15 23:18:17 Author: Amu Description:
Package logger Date: 2022/12/15 23:17:48 Author: Amu Description:
Package logger Date: 2022/12/15 23:18:51 Author: Amu Description:
Index ¶
- Constants
- func CreateLogger(options ...Option)
- func Debug(args ...any)
- func Debugf(args ...any)
- func Error(args ...any)
- func Errorf(args ...any)
- func Fatal(args ...any)
- func Fatalf(args ...any)
- func Info(args ...any)
- func Infof(args ...any)
- func InitLogger(options ...Option)
- func Panic(args ...any)
- func Panicf(args ...any)
- func Warn(args ...any)
- func Warnf(args ...any)
- type Config
- type Logger
- func (l *Logger) CreateLogger(options ...Option)
- func (l *Logger) Debug(args ...any)
- func (l *Logger) Debugf(args ...any)
- func (l *Logger) Error(args ...any)
- func (l *Logger) Errorf(args ...any)
- func (l *Logger) Fatal(args ...any)
- func (l *Logger) Fatalf(args ...any)
- func (l *Logger) Info(args ...any)
- func (l *Logger) Infof(args ...any)
- func (l *Logger) NewField(key string, value any) *Logger
- func (l *Logger) Panic(args ...any)
- func (l *Logger) Panicf(args ...any)
- func (l *Logger) Warn(args ...any)
- func (l *Logger) Warnf(args ...any)
- type Option
- func SetLogFile(logFile string) Option
- func SetLogFileMaxAge(duration time.Duration) Option
- func SetLogFileRotationTime(duration time.Duration) Option
- func SetLogFileSuffix(suffix string) Option
- func SetLogFormat(format string) Option
- func SetLogLevel(level string) Option
- func SetLogOutput(output string) Option
- func SetLogSeparator(separator string) Option
- func SetName(name string) Option
Constants ¶
View Source
const ( PanicLevel = zapcore.PanicLevel FatalLevel = zapcore.FatalLevel ErrorLevel = zapcore.ErrorLevel WarnLevel = zapcore.WarnLevel InfoLevel = zapcore.InfoLevel DebugLevel = zapcore.DebugLevel )
View Source
const (
TimeFormat = "2006-01-02 15:04:05"
)
Variables ¶
This section is empty.
Functions ¶
func CreateLogger ¶
func CreateLogger(options ...Option)
func InitLogger ¶
func InitLogger(options ...Option)
Types ¶
type Option ¶
type Option func(*Config)
func SetLogFile ¶
func SetLogFileMaxAge ¶
func SetLogFileRotationTime ¶
func SetLogFileSuffix ¶
func SetLogFormat ¶
func SetLogLevel ¶
func SetLogOutput ¶
func SetLogSeparator ¶
Click to show internal directories.
Click to hide internal directories.