Documentation ¶
Index ¶
- Constants
- func FileWriter(cfg *FileConfig, showStdout bool) zapcore.WriteSyncer
- func GetEncode(isJson bool, cfg zapcore.EncoderConfig) zapcore.Encoder
- func StdOutWriter() zapcore.WriteSyncer
- type Config
- func (c *Config) OutInfoConsoleErrorFile() *Config
- func (c *Config) OutMultiFile(withConsole bool) *Config
- func (c *Config) OutSingleFile(withConsole bool) *Config
- func (c *Config) SetCallSkip(skip int) *Config
- func (c *Config) SetEnable(enable bool) *Config
- func (c *Config) SetErrorFileConfig(opts ...Option) *Config
- func (c *Config) SetFileConfig(opts ...Option) *Config
- func (c *Config) SetInfoFileConfig(opts ...Option) *Config
- func (c *Config) SetLevel(level string) *Config
- func (c *Config) ShowCaller(enabled bool) *Config
- func (c *Config) ShowStacktrace(enabled bool) *Config
- func (c *Config) UseFmtJson(enabled bool) *Config
- type FileConfig
- type Logger
- func (l *Logger) Debug(msg string, fields ...zap.Field)
- func (l *Logger) Error(msg string, fields ...zap.Field)
- func (l *Logger) Fatal(msg string, fields ...zap.Field)
- func (l *Logger) Info(msg string, fields ...zap.Field)
- func (l *Logger) Panic(msg string, fields ...zap.Field)
- func (l *Logger) SDebug(args ...interface{})
- func (l *Logger) SDebugf(template string, args ...interface{})
- func (l *Logger) SDebugw(msg string, keysAndValues ...interface{})
- func (l *Logger) SError(args ...interface{})
- func (l *Logger) SErrorf(template string, args ...interface{})
- func (l *Logger) SErrorw(msg string, keysAndValues ...interface{})
- func (l *Logger) SFatal(args ...interface{})
- func (l *Logger) SFatalf(template string, args ...interface{})
- func (l *Logger) SFatalw(msg string, keysAndValues ...interface{})
- func (l *Logger) SInfo(args ...interface{})
- func (l *Logger) SInfof(template string, args ...interface{})
- func (l *Logger) SInfow(msg string, keysAndValues ...interface{})
- func (l *Logger) SPanic(args ...interface{})
- func (l *Logger) SPanicf(template string, args ...interface{})
- func (l *Logger) SPanicw(msg string, keysAndValues ...interface{})
- func (l *Logger) SWarn(args ...interface{})
- func (l *Logger) SWarnf(template string, args ...interface{})
- func (l *Logger) SWarnw(msg string, keysAndValues ...interface{})
- func (l *Logger) Sync() error
- func (l *Logger) Warn(msg string, fields ...zap.Field)
- type OTP
- type Option
Constants ¶
View Source
const ( DefaultSingleFilename = "logs/rzap.log" DefaultMultiFilenameInfo = "logs/info.log" DefaultMultiFilenameError = "logs/error.log" )
Variables ¶
This section is empty.
Functions ¶
func FileWriter ¶ added in v0.1.0
func FileWriter(cfg *FileConfig, showStdout bool) zapcore.WriteSyncer
func GetEncode ¶ added in v0.1.0
func GetEncode(isJson bool, cfg zapcore.EncoderConfig) zapcore.Encoder
func StdOutWriter ¶ added in v0.1.0
func StdOutWriter() zapcore.WriteSyncer
Types ¶
type Config ¶ added in v0.0.2
type Config struct {
// contains filtered or unexported fields
}
func (*Config) OutInfoConsoleErrorFile ¶ added in v0.1.0
OutInfoConsoleErrorFile Default error log path "logs/error.log"
func (*Config) OutMultiFile ¶ added in v0.1.0
OutMultiFile Default info log path "logs/info.log"; default error log path "logs/error.log"
func (*Config) OutSingleFile ¶ added in v0.1.0
OutSingleFile Default log path "logs/rzap.log"
func (*Config) SetCallSkip ¶ added in v0.1.0
func (*Config) SetErrorFileConfig ¶ added in v0.1.0
func (*Config) SetFileConfig ¶ added in v0.1.0
func (*Config) SetInfoFileConfig ¶ added in v0.1.0
func (*Config) ShowCaller ¶ added in v0.1.0
func (*Config) ShowStacktrace ¶ added in v0.1.0
func (*Config) UseFmtJson ¶ added in v0.1.0
type FileConfig ¶ added in v0.1.0
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
type Option ¶ added in v0.1.0
type Option func(f *FileConfig)
func WithCompress ¶ added in v0.1.0
func WithFileName ¶ added in v0.1.0
func WithLocalTime ¶ added in v0.1.0
func WithMaxAge ¶ added in v0.1.0
func WithMaxBackups ¶ added in v0.1.0
func WithMaxSize ¶ added in v0.1.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.