Documentation ¶
Index ¶
- Constants
- func Debug(msg string, fields ...zap.Field)
- func Debugf(template string, args ...any)
- func Error(msg string, fields ...zap.Field)
- func Errorf(template string, args ...any)
- func Fatal(msg string, fields ...zap.Field)
- func Fatalf(template string, args ...any)
- func Info(msg string, fields ...zap.Field)
- func Infof(template string, args ...any)
- func Panic(msg string, fields ...zap.Field)
- func Panicf(template string, args ...any)
- func Trace(msg string, fields ...zap.Field)
- func Warn(msg string, fields ...zap.Field)
- func Warnf(template string, args ...any)
- type Config
- func (c *Config) Init()
- func (c *Config) WithErrorLog(optionErrorLogFilename string) *Config
- func (c *Config) WithFields(fields map[string]any) *Config
- func (c *Config) WithFilename(filename string) *Config
- func (c *Config) WithHumanTime(location *time.Location) *Config
- func (c *Config) WithLevel(level Level) *Config
- func (c *Config) WithWarnLog(optionWarnLogFilename string) *Config
- type FieldsConfig
- type FileConfig
- type Level
- type LevelFilterFileConfig
- type StdoutConfig
Constants ¶
View Source
const DefaultFilename = "./app.log"
View Source
const HumanTime = "_human_time"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (*Config) WithErrorLog ¶ added in v0.5.0
func (*Config) WithFields ¶ added in v0.3.3
func (*Config) WithFilename ¶
func (*Config) WithHumanTime ¶ added in v0.3.4
func (*Config) WithWarnLog ¶ added in v0.5.0
type FieldsConfig ¶ added in v0.3.3
type FieldsConfig struct {
// contains filtered or unexported fields
}
type FileConfig ¶
type FileConfig struct {
// contains filtered or unexported fields
}
type Level ¶ added in v0.3.1
type Level int8
A Level is a logging priority. Higher levels are more important.
const ( // DebugLevel logs are typically voluminous, and are usually disabled in // production. DebugLevel Level = iota - 1 // InfoLevel is the default logging priority. InfoLevel // WarnLevel logs are more important than Info, but don't need individual // human review. WarnLevel // ErrorLevel logs are high-priority. If an application is running smoothly, // it shouldn't generate any error-level logs. ErrorLevel // DPanicLevel logs are particularly important errors. In development the // logger panics after writing the message. DPanicLevel // PanicLevel logs a message, then panics. PanicLevel // FatalLevel logs a message, then calls os.Exit(1). FatalLevel // InvalidLevel is an invalid value for Level. // // Core implementations may panic if they see messages of this level. InvalidLevel = _maxLevel + 1 )
type LevelFilterFileConfig ¶ added in v0.5.0
type LevelFilterFileConfig struct {
// contains filtered or unexported fields
}
type StdoutConfig ¶
type StdoutConfig struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.