Documentation ¶
Index ¶
- func Assert(format string, v ...any)
- func Debug(format string, v ...any)
- func Error(format string, v ...any)
- func Fatal(format string, v ...any)
- func Info(format string, v ...any)
- func InitLog(appName string, cfg *LoggerConfig)
- func Panic(format string, v ...any)
- func SetGlobalLevel(strLevel string)
- func Warn(format string, v ...any)
- type FileLevelWriter
- type Handler
- type LoggerConfig
- type Strategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitLog ¶ added in v0.7.0
func InitLog(appName string, cfg *LoggerConfig)
InitLog create a root logger. it will write to console and multiple file by level. note: default set root logger level is info it provides custom log with CustomizeFiles,if it match any caller's name ,log's level will be setting debug and output
func SetGlobalLevel ¶ added in v0.7.0
func SetGlobalLevel(strLevel string)
SetGlobalLevel sets the global override for log level. If this values is raised, all Loggers will use at least this value.
To globally disable logs, set zerolog.GlobalLevel to Disabled.
Types ¶
type FileLevelWriter ¶ added in v0.9.0
func (*FileLevelWriter) WriteLevel ¶ added in v0.9.0
type Handler ¶ added in v1.0.13
type Handler interface { //Dup2 THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT Dup2(newfd *FileLevelWriter, oldfd *os.File) (err error) }
type LoggerConfig ¶ added in v1.0.10
type LoggerConfig struct { Level string `yaml:"level"` Time struct { Format string `yaml:"format"` } `yaml:"time"` Color struct { Enable bool `yaml:"enable"` } `yaml:"color"` Split struct { Enable bool `yaml:"enable"` Size int64 `yaml:"size"` } `yaml:"split"` Dir string `yaml:"dir"` Max struct { History int `yaml:"history"` } `yaml:"max"` Panic bool `yaml:"panic"` }
Click to show internal directories.
Click to hide internal directories.