logger

package
v0.4.14-test2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelDim     = slog.Level(-2)
	LevelSuccess = slog.Level(2)
)

Variables

This section is empty.

Functions

func Debug added in v0.4.13

func Debug(msg string)

func DebugMultilineYaml added in v0.4.13

func DebugMultilineYaml(v any)

func Debugf added in v0.4.13

func Debugf(f string, a ...any)

func Dim added in v0.4.13

func Dim(msg string)

func Dimf added in v0.4.13

func Dimf(f string, a ...any)

func Error added in v0.4.13

func Error(msg string)

func Errorf added in v0.4.13

func Errorf(f string, a ...any)

func Info added in v0.4.13

func Info(msg string)

func Infof added in v0.4.13

func Infof(f string, a ...any)

func IsVerbose added in v0.4.13

func IsVerbose() bool

func SetVerbose added in v0.4.13

func SetVerbose(v bool)

func Success added in v0.4.13

func Success(msg string)

func Successf added in v0.4.13

func Successf(f string, a ...any)

func Warning added in v0.4.13

func Warning(msg string)

func Warningf added in v0.4.13

func Warningf(f string, a ...any)

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger wraps slog.Logger with roxie's CLI output style: elapsed MM:SS timestamps, per-level coloring, and stdout/stderr routing.

func Default added in v0.4.13

func Default() *Logger

func New

func New() *Logger

New creates a new roxie logger.

func NewWithWriters added in v0.4.13

func NewWithWriters(stdout, stderr io.Writer) *Logger

NewWithWriters creates a new roxie logger with configurable writers for stdout/stderr.

func SetDefault added in v0.4.13

func SetDefault(l *Logger) *Logger

func (*Logger) Debug added in v0.4.13

func (l *Logger) Debug(message string)

Debug prints a faint message only visible in verbose mode.

func (*Logger) DebugMultilineYaml added in v0.4.13

func (l *Logger) DebugMultilineYaml(v any)

DebugMultilineYaml marshals v to YAML and logs it line by line at debug level. It is a no-op unless verbose mode is enabled, so callers need no guard.

func (*Logger) Debugf added in v0.4.13

func (l *Logger) Debugf(format string, args ...any)

Debug prints a formatted faint message only visible in verbose mode.

func (*Logger) Dim

func (l *Logger) Dim(message string)

Dim prints a faint message that is always visible. For verbose-only output, use Debug/Debugf.

func (*Logger) Dimf

func (l *Logger) Dimf(format string, args ...any)

Dimf prints a formatted faint message that is always visible.

func (*Logger) Error

func (l *Logger) Error(message string)

Error prints an error message with red styling to stderr.

func (*Logger) Errorf

func (l *Logger) Errorf(format string, args ...any)

Errorf prints a formatted error message with red styling to stderr.

func (*Logger) Info

func (l *Logger) Info(message string)

Info prints an info message with magenta styling.

func (*Logger) Infof

func (l *Logger) Infof(format string, args ...any)

Infof prints a formatted info message with magenta styling.

func (*Logger) IsVerbose added in v0.4.13

func (l *Logger) IsVerbose() bool

IsVerbose returns true if verbose mode is enabled.

func (*Logger) SetVerbose added in v0.4.13

func (l *Logger) SetVerbose(verbose bool)

SetVerbose enables verbose mode for the logger, which means that debug-level messages will be emitted.

func (*Logger) Success

func (l *Logger) Success(message string)

Success prints a success message with green styling.

func (*Logger) Successf

func (l *Logger) Successf(format string, args ...any)

Successf prints a formatted success message with green styling.

func (*Logger) Warning

func (l *Logger) Warning(message string)

Warning prints a warning message with yellow styling.

func (*Logger) Warningf

func (l *Logger) Warningf(format string, args ...any)

Warningf prints a formatted warning message with yellow styling.

Jump to

Keyboard shortcuts

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