Documentation ¶
Index ¶
- func Logger() *zap.Logger
- func NewLogger() (*zap.SugaredLogger, *zap.Logger, error)
- func SetKafkaBrokers(kafkaBrokers string)
- func SetKafkaTopic(kafkaTopic string)
- func SetLogLevel(logLevel LogLevel)
- func SetLogPath(logPath string)
- func SetMaxAge(maxAge int)
- func SetMaxBackups(maxBackups int)
- func SetMaxSize(maxSize int)
- func SetMode(mode string)
- func SetOutput(output string)
- func SugaredLogger() *zap.SugaredLogger
- type Config
- type Log
- type LogLevel
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLogger ¶
func NewLogger() (*zap.SugaredLogger, *zap.Logger, error)
NewLogger initializes the logger and returns a sugared logger.
func SetKafkaBrokers ¶
func SetKafkaBrokers(kafkaBrokers string)
SetKafkaBrokers sets the Kafka brokers.
func SetMaxBackups ¶
func SetMaxBackups(maxBackups int)
SetMaxBackups sets the maximum number of backup log files.
func SugaredLogger ¶
func SugaredLogger() *zap.SugaredLogger
SugaredLogger returns the initialized sugared logger.
Types ¶
type Config ¶
type Config struct { LogPath string MaxSize int MaxBackups int MaxAge int LogLevel LogLevel Output string Mode string KafkaBrokers string KafkaTopic string }
Config holds logger configuration options.
Click to show internal directories.
Click to hide internal directories.