Documentation
¶
Overview ¶
Package logger provides configurable logging capabilities
internal/logger/logger.go
Index ¶
- func DebugTagf(tag, format string, args ...interface{})
- func Debugf(format string, args ...interface{})
- func EnableFilterDebug(enable bool)
- func ErrorTagf(tag, format string, args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Get() *slog.Logger
- func InfoTagf(tag, format string, args ...interface{})
- func Infof(format string, args ...interface{})
- func Init(cfg Config)
- func WarnTagf(tag, format string, args ...interface{})
- func Warnf(format string, args ...interface{})
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugTagf ¶
func DebugTagf(tag, format string, args ...interface{})
DebugTagf logs a debug message with a tag using Printf-style formatting.
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf logs a debug message using Printf-style formatting.
func EnableFilterDebug ¶
func EnableFilterDebug(enable bool)
EnableFilterDebug turns on debug output for filtering decisions
func ErrorTagf ¶
func ErrorTagf(tag, format string, args ...interface{})
ErrorTagf logs an error message with a tag using Printf-style formatting.
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf logs an error message using Printf-style formatting.
func Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf logs an error message then exits.
func InfoTagf ¶
func InfoTagf(tag, format string, args ...interface{})
InfoTagf logs an info message with a tag using Printf-style formatting.
func Infof ¶
func Infof(format string, args ...interface{})
Infof logs an info message using Printf-style formatting.
Types ¶
type Config ¶
type Config struct {
// LogLevel specifies the minimum level to log (e.g., "debug", "info", "warn", "error").
LogLevel string
// LogFilePath is the path to the output log file. Use empty or "-" for stderr.
LogFilePath string
// EnabledTags only logs messages with these tags (if non-empty).
EnabledTags []string
// DisabledTags prevents logging messages with these tags. Overrides EnabledTags.
DisabledTags []string
// EnabledPackages only logs messages originating from these packages (if non-empty).
// Package name is the immediate directory name (e.g., "core", "theme", "app").
EnabledPackages []string
// DisabledPackages prevents logging from these packages. Overrides EnabledPackages.
DisabledPackages []string
// EnabledFiles only logs messages originating from these filenames (if non-empty).
// Filename is the base name (e.g., "editor.go", "manager.go").
EnabledFiles []string
// DisabledFiles prevents logging from these filenames. Overrides EnabledFiles.
DisabledFiles []string
// contains filtered or unexported fields
}
Config holds all settings for the logger.
Click to show internal directories.
Click to hide internal directories.