Documentation
¶
Overview ¶
Package logging provides structured logging for goplexcli using slog. It supports configurable log levels and can be enabled via --verbose flag.
Index ¶
- Constants
- func Debug(msg string, args ...any)
- func Enabled(level slog.Level) bool
- func Error(msg string, args ...any)
- func Info(msg string, args ...any)
- func Init(opts ...Option)
- func IsVerbose() bool
- func Logger() *slog.Logger
- func SetLevel(level slog.Level)
- func SetVerbose(verbose bool)
- func Warn(msg string, args ...any)
- func With(args ...any) *slog.Logger
- type Option
Constants ¶
View Source
const ( LevelDebug = slog.LevelDebug LevelInfo = slog.LevelInfo LevelWarn = slog.LevelWarn LevelError = slog.LevelError )
Level constants for convenience
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(opts ...Option)
Init initializes the logger with the specified options. This should be called early in main() before any logging occurs. If not called, a default logger will be created on first use.
func SetVerbose ¶
func SetVerbose(verbose bool)
SetVerbose is a convenience function to enable/disable verbose logging
Types ¶
type Option ¶
type Option func(*config)
Option is a functional option for configuring the logger
func WithVerbose ¶
WithVerbose enables verbose (debug) logging
Click to show internal directories.
Click to hide internal directories.