log

package
v1.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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 Debug

func Debug(msg any, kv ...any)

func Debugf

func Debugf(format string, v ...any)

func Error

func Error(msg any, kv ...any)

func Errorf

func Errorf(format string, v ...any)

func Fatal

func Fatal(msg any, kv ...any)

func Fatalf

func Fatalf(format string, v ...any)

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 Info

func Info(msg any, kv ...any)

func Infof

func Infof(format string, v ...any)

func SetEnvPrefix

func SetEnvPrefix(prefix string)

func SetLevel

func SetLevel(level string)

func SetLogFile

func SetLogFile(path string) error

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.

func SetPrefix

func SetPrefix(p string)

func Warn

func Warn(msg any, kv ...any)

func Warnf

func Warnf(format string, v ...any)

Types

type Logger

type Logger struct{ *cblog.Logger }

func GetLogger

func GetLogger() *Logger

func (*Logger) Fatalf

func (l *Logger) Fatalf(format string, v ...any)

func (*Logger) Printf

func (l *Logger) Printf(format string, v ...any)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL