Documentation
¶
Index ¶
- func Debug(msg string, fields ...zap.Field)
- func Debugf(format string, args ...interface{})
- func Error(msg string, fields ...zap.Field)
- func Errorf(format string, args ...interface{})
- func Fatal(msg string, fields ...zap.Field)
- func GetLogger() *zap.Logger
- func Info(msg string, fields ...zap.Field)
- func Infof(format string, args ...interface{})
- func InitLoggerFromConfig(cfg *types.LogConfig) *zap.Logger
- func Setup(level string, filePath string, maxSize, maxBackups, maxAge int, compress bool, ...)
- func Sugar() *zap.SugaredLogger
- func Sync()
- func Warn(msg string, fields ...zap.Field)
- func Warnf(format string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf logs a formatted message at the debug level.
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf logs a formatted message at the error level.
func GetLogger ¶
GetLogger returns the logger instance. If the logger has not been initialized, it sets it up with a default configuration.
func Infof ¶
func Infof(format string, args ...interface{})
Infof logs a formatted message at the info level.
func InitLoggerFromConfig ¶
InitLoggerFromConfig initializes the logger from a configuration object. It sets up the logger with specified settings for level, file path, rotation, and console output.
func Setup ¶
func Setup(level string, filePath string, maxSize, maxBackups, maxAge int, compress bool, env string, enableConsole bool)
Setup initializes the logging system. It configures the logger's level, output path, rotation policies, and console logging based on the provided parameters. This function is designed to be called only once.
func Sugar ¶
func Sugar() *zap.SugaredLogger
Sugar returns a `SugaredLogger` for more convenient logging methods.
Types ¶
This section is empty.