Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Zero = NewZeroLogger("")
Functions ¶
func GetPointer ¶
func GetPointer(value interface{}) uint
GetPointer do the same thing like fmt.Sprintf("%p", &num) but fast GetPointer returns the memory address of the given value as an unsigned integer.
func IsDebugLevel ¶
func IsDebugLevel() bool
func NewZeroLogger ¶
NewZeroLogger creates a new ZeroLogger with the specified filepath. It initializes a writer and creates a logger with a timestamp. The logger is returned as a pointer to a zerolog.Logger. If the filepath is empty, the logger will be set to os.Stdout. Otherwise, a new log file will be opened and used for logging.
Parameters:
- filepath: The path to the log file where the data will be written.
Returns:
- *zerolog.Logger: A pointer to the created ZeroLogger.
func ReloadLogger ¶
func ReloadLogger(filepath string)
ReloadLogger reloads the logger with a new log file. If the filepath is empty, the logger will be set to os.Stdout. Otherwise, a new log file will be opened and used for logging.
Parameters:
- filepath: The path to the log file where the data will be written.
func UpdateZeroLogLevel ¶
UpdateZeroLogLevel updates the log level of the Zero logger. It takes a logLevel string as input and returns an error if any. The logLevel string should be one of the following: "debug", "info", "warn", "error", "fatal", "panic". If the logLevel string is invalid, the function will return an error.
Parameters:
- logLevel: The log level to set for the Zero logger.
Returns:
- error: An error if any error occurs during the process.
Types ¶
This section is empty.