Documentation ¶
Overview ¶
Package logx Date: 2023/4/10 17:18 Author: Amu Description:
Package logx Date: 2023/4/10 17:39 Author: Amu Description:
Package logx Date: 2023/4/10 17:23 Author: Amu Description:
Package logx Date: 2023/4/10 17:17 Author: Amu Description:
Package logx Date: 2023/4/10 17:14 Author: Amu Description:
Package logx Date: 2023/4/10 17:19 Author: Amu Description:
Package logx Date: 2023/4/10 17:24 Author: Amu Description:
Index ¶
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Field(key string, value interface{}) zap.Field
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func NewLogger(options ...Option)
- func Panic(args ...interface{})
- func Panicf(format string, args ...interface{})
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- func WithField(fields ...zap.Field)
- type Config
- type Logger
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Fatal(args ...interface{})
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) NewLogger(options ...Option)
- func (l *Logger) Panic(args ...interface{})
- func (l *Logger) Panicf(format string, v ...interface{})
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) Warnf(format string, v ...interface{})
- func (l *Logger) WithField(fields ...zap.Field)
- type Option
- func SetLogFile(logFile string) Option
- func SetLogFileMaxAge(duration int) Option
- func SetLogFileRotationTime(duration int) Option
- func SetLogFileSuffix(suffix string) Option
- func SetLogFormat(format string) Option
- func SetLogLevel(level string) Option
- func SetLogOutput(output string) Option
- func SetName(name string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Name string `default:"std"` // 【默认】Logger 名称 LogFile string `default:"scanner.log"` // 【默认】日志文件名称 LogLevel zapcore.Level `default:"info"` // 【默认】日志打印级别 LogFormat string `default:"text"` // 【默认】日志打印样式,支持 text 和 json LogFileRotationTime int `default:"1"` // 【默认】日志文件切割间隔,单位 D LogFileMaxAge int `default:"7"` // 【默认】日志文件保留时间,单位 D LogOutput string `default:"stdout"` // 【默认】日志输出位置,只会 stdout iohelper LogFileSuffix string `default:".%Y%m%d"` // 【默认】归档日志后缀 }
type Option ¶
type Option func(*Config)
func SetLogFile ¶
func SetLogFileMaxAge ¶
func SetLogFileRotationTime ¶
func SetLogFileSuffix ¶
func SetLogFormat ¶
func SetLogLevel ¶
func SetLogOutput ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.