Documentation
¶
Index ¶
- func ApplyEnvOverrides()
- func Debug(msg any, kv ...any)
- func Debugf(format string, v ...any)
- func Error(msg any, kv ...any)
- func Errorf(format string, v ...any)
- func Fatal(msg any, kv ...any)
- func Fatalf(format string, v ...any)
- func GetQtLoggingRules() string
- func Info(msg any, kv ...any)
- func Infof(format string, v ...any)
- func SetEnvPrefix(prefix string)
- func SetLevel(level string)
- func SetLogFile(path string) error
- func SetPrefix(p string)
- func Warn(msg any, kv ...any)
- func Warnf(format string, v ...any)
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyEnvOverrides ¶
func ApplyEnvOverrides()
ApplyEnvOverrides re-reads <PREFIX>_LOG_LEVEL and <PREFIX>_LOG_FILE and reconfigures the singleton. Safe to call after CLI flags have rewritten the environment.
func GetQtLoggingRules ¶
func GetQtLoggingRules() string
GetQtLoggingRules returns a QT_LOGGING_RULES string that mirrors the configured <PREFIX>_LOG_LEVEL so Qt-side logs respect the same threshold.
func SetEnvPrefix ¶
func SetEnvPrefix(prefix string)
func SetLogFile ¶
SetLogFile makes the logger append to path in addition to stderr. Passing an empty string detaches the file sink. Atomic per-line writes (≤PIPE_BUF) on O_APPEND keep concurrent Go and QML writers from corrupting each other.
charmbracelet/log auto-detects color support from its io.Writer, and io.MultiWriter doesn't pass that through, so we force the ANSI profile when stderr is a TTY and route the file through ansiStripWriter so the file stays plain while stderr keeps its colors.