import "github.com/image357/password/log"- Constants
- 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)
const LevelDebug = slog.LevelDebugconst LevelError = slog.LevelErrorconst LevelInfo = slog.LevelInfoconst LevelWarn = slog.LevelWarnCustomLoggerLevel stores the current log level. Set it with Level()
var CustomLoggerLevel = &slog.LevelVar{}Logger is the global log instance. Overwrite it with any slog.New() compatible logger to use your custom logger.
var Logger = slog.Default()LoggerFileMode controls the file permission set by the custom file loggers of this package.
var LoggerFileMode os.FileMode = 0600func Debug
func Debug(msg string, args ...any)Debug will call [slog.Logger.Debug] on the global logger.
func Error
func Error(msg string, args ...any)Error will call [slog.Logger.Error] on the global logger.
func Info
func Info(msg string, args ...any)Info will call [slog.Logger.Info] on the global logger.
func Level
func Level(level slog.Level) (oldLevel slog.Level)Level sets the global log level and returns the previous value.
func SetDefault
func SetDefault()SetDefault will set the global Logger variable to slog.Default()
func SetFileJSON
func SetFileJSON(filePath string) errorSetFileJSON will set a custom file logger with JSON format.
func SetFileText
func SetFileText(filePath string) errorSetFileText will set a custom file logger with text format.
func SetMultiJSON
func SetMultiJSON(filePath string) errorSetMultiJSON will set a custom logger with JSON format, that will write into a file and os.Stderr.
func SetMultiText
func SetMultiText(filePath string) errorSetMultiText 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
func Warn(msg string, args ...any)Warn will call [slog.Logger.Warn] on the global logger.
Generated by gomarkdoc