Documentation
¶
Index ¶
- Variables
- func Debug(msg string, args ...any)
- func Error(msg string, args ...any)
- func Info(msg string, args ...any)
- func Level(level slog.Level) (oldLevel slog.Level)
- func SetDefault()
- func SetFileJSON(filePath string) error
- func SetFileText(filePath string) error
- func SetMultiJSON(filePath string) error
- func SetMultiText(filePath string) error
- func SetStderrJSON()
- func SetStderrText()
- func Warn(msg string, args ...any)
Constants ¶
This section is empty.
Variables ¶
var CustomLoggerLevel = &slog.LevelVar{}
CustomLoggerLevel stores the current log level. Set it with Level()
var Logger = slog.Default()
Logger is the global log instance. Overwrite it with any slog.New() compatible logger to use your custom logger.
var LoggerFileMode os.FileMode = 0600
LoggerFileMode controls the file permission set by the custom file loggers of this package.
Functions ¶
func Debug ¶
Debug will call slog.Logger.Debug on the global logger.
func Error ¶
Error will call slog.Logger.Error on the global logger.
func Info ¶
Info will call slog.Logger.Info on the global logger.
func SetDefault ¶
func SetDefault()
SetDefault will set the global Logger variable to slog.Default()
func SetFileJSON ¶
SetFileJSON will set a custom file logger with JSON format.
func SetFileText ¶
SetFileText will set a custom file logger with text format.
func SetMultiJSON ¶
SetMultiJSON will set a custom logger with JSON format, that will write into a file and os.Stderr.
func SetMultiText ¶
SetMultiText will set a custom logger with text format, that will write into a file and os.Stderr.
func SetStderrJSON ¶
func SetStderrJSON()
SetStderrJSON will set a custom os.Stderr logger with JSON format.
func SetStderrText ¶
func SetStderrText()
SetStderrText will set a custom os.Stderr logger with text format.
func Warn ¶
Warn will call slog.Logger.Warn on the global logger.
Types ¶
This section is empty.