Documentation ¶
Index ¶
- Constants
- Variables
- func CloseGlobalLogFile() error
- func CreateGlobalLogFile(outputDir, logLevel string) error
- func Debug(msg string, args ...any)
- func Error(msg string, args ...any)
- func Fatal(msg string, args ...any)
- func Info(msg string, args ...any)
- func Logf(logger *Logger, level, format string, args ...any)
- func SetLogger(l *Logger)
- func SetupLogger(logWriter io.Writer, level string)
- func Warn(msg string, args ...any)
- type CustomHandler
- type Logger
- func (logger *Logger) Debug(msg string, args ...any)
- func (logger *Logger) Error(msg string, args ...any)
- func (logger *Logger) Fatal(msg string, args ...any)
- func (logger *Logger) Info(msg string, args ...any)
- func (logger *Logger) Warn(msg string, args ...any)
- func (logger *Logger) With(args ...any) *Logger
- type MultiHandler
Constants ¶
View Source
const ( LogFileName = "certsuite.log" LogFilePermissions = 0o644 )
View Source
const ( LevelDebug = "debug" LevelInfo = "info" LevelWarn = "warn" LevelError = "error" LevelFatal = "fatal" )
Log levels
View Source
const CustomLevelFatal = slog.Level(12)
Custom log levels
Variables ¶
View Source
var CustomLevelNames = map[slog.Leveler]string{ CustomLevelFatal: "FATAL", }
Functions ¶
func CloseGlobalLogFile ¶
func CloseGlobalLogFile() error
func CreateGlobalLogFile ¶
func Logf ¶
The Logf function should be called inside a log wrapper function. Otherwise the code source reference will be invalid.
func SetupLogger ¶
Types ¶
type CustomHandler ¶
type CustomHandler struct {
// contains filtered or unexported fields
}
func NewCustomHandler ¶
func NewCustomHandler(out io.Writer, opts *slog.HandlerOptions) *CustomHandler
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func GetMultiLogger ¶
type MultiHandler ¶
type MultiHandler struct {
// contains filtered or unexported fields
}
func NewMultiHandler ¶
func NewMultiHandler(handlers ...slog.Handler) *MultiHandler
Click to show internal directories.
Click to hide internal directories.