Documentation
¶
Index ¶
- Variables
- func Contains(s, substr string) bool
- func Debug(msg string, args ...any)
- func Error(msg string, args ...any)
- func FormatBytes(bytes int64) string
- func FormatDuration(ms int64) string
- func Info(msg string, args ...any)
- func InitLogger(logPath string, level LogLevel) error
- func SetVerbose()
- func ShortenPath(path string, maxLen int) string
- func Warn(msg string, args ...any)
- func With(args ...any) *slog.Logger
- type LogLevel
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger *slog.Logger
Logger is the global logger instance.
Functions ¶
func FormatBytes ¶
FormatBytes converts a byte count to a human-readable string.
func FormatDuration ¶
FormatDuration converts milliseconds to a human-readable duration string.
func InitLogger ¶
InitLogger initializes the global logger.
func ShortenPath ¶
ShortenPath truncates a path to fit within maxLen characters. It preserves the end of the path and adds "..." prefix if truncated.
Types ¶
Click to show internal directories.
Click to hide internal directories.