Documentation
¶
Index ¶
- func Category(name string, desc *string, displayMode CategoryDisplayMode)
- func CloseLogger()
- func Debug(format string, args ...any)
- func Error(format string, args ...any)
- func GetDefaultLogFile() string
- func GetLogDir() string
- func GetLogFile() string
- func H(text string) string
- func Highlight(text string) string
- func Info(format string, args ...any)
- func SetLogFile(path string)
- func Spew(v any)
- func Warn(format string, args ...any)
- type CategoryDisplayMode
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Category ¶ added in v1.19.0
func Category(name string, desc *string, displayMode CategoryDisplayMode)
Category logs a category header with a decorative border. If desc is provided, it will be displayed below the category name with auto-wrapping. The displayMode controls the visual style: "border" (default), "border-compact", or "minimal".
func GetDefaultLogFile ¶ added in v1.14.0
func GetDefaultLogFile() string
GetDefaultLogFile returns the default log file path.
func GetLogDir ¶ added in v1.1.0
func GetLogDir() string
GetLogDir returns the appropriate log directory based on the operating system.
func GetLogFile ¶ added in v1.14.0
func GetLogFile() string
GetLogFile returns the current log file path (custom or default).
func Highlight ¶ added in v1.18.0
Highlight marks text to be displayed in white/bold in console output. Use this for installer names, types, and other important identifiers.
func SetLogFile ¶ added in v1.14.0
func SetLogFile(path string)
SetLogFile sets a custom log file path.
Types ¶
type CategoryDisplayMode ¶ added in v1.20.0
type CategoryDisplayMode string
CategoryDisplayMode controls how category headers are rendered.
const ( // CategoryDisplayBorder renders categories with a full border and spacing. CategoryDisplayBorder CategoryDisplayMode = "border" // CategoryDisplayBorderCompact renders categories with a border but no spacing. CategoryDisplayBorderCompact CategoryDisplayMode = "border-compact" // CategoryDisplayMinimal renders categories without a border or spacing. CategoryDisplayMinimal CategoryDisplayMode = "minimal" )
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger provides logging functionality with support for file and console output.
func InitLogger ¶
InitLogger initializes the global logger with the specified debug mode. It creates the log directory and file if they don't exist. If the log file exceeds maxLogSize, it will be truncated.