Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFileLogger ¶
func NewFileLogger(opts *FileLoggerOptions) (*lumberjack.Logger, error)
func NewZapLogger ¶
func NewZapLogger(opts *LoggerOptions) (*zap.Logger, error)
Create a new zap logger
func ParseLogLevel ¶
func ParseLogLevel(level string) zap.AtomicLevel
Types ¶
type FileLoggerOptions ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewLogger ¶
func NewLogger(opts *LoggerOptions) (*Logger, error)
type LoggerContract ¶
type LoggerOptions ¶
type LoggerOptions struct { // Log level: debug, info, warn, error, fatal LogLevel string // Where to output logs; console, file LogOutput string // Log output format: text, json LogFormat string // Log file prefix (only used when LogOutput is file) LogFilePrefix string // Log directory (only used when LogOutput is file) LogDirectory string // Max file size in MB (only used when LogOutput is file) MaxFileSize int }
Click to show internal directories.
Click to hide internal directories.