log

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLILogger

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

CLILogger is a simple logger for command line applications that outputs colored logs

func NewCLILogger

func NewCLILogger(key string, verbose bool) *CLILogger

NewCLILogger creates a new instance of CLILogger with the specified key, verbosity and column width.

func NewTestLogger added in v0.6.0

func NewTestLogger(key string, verbose bool, stdout, stderr io.Writer) *CLILogger

NewTestLogger creates a CLILogger for testing with custom writers

func (CLILogger) Debug

func (l CLILogger) Debug(format string, args ...any)

Debug outputs a debug log to the stdout if verbose mode is enabled

func (CLILogger) Error

func (l CLILogger) Error(err error)

Error outputs an error log to the stderr

func (CLILogger) Info

func (l CLILogger) Info(format string, args ...any)

Info outputs an info log to the stdout

func (CLILogger) Warn

func (l CLILogger) Warn(format string, args ...any)

Warn outputs a warning log to the stdout

type Logger added in v0.6.0

type Logger interface {
	Info(format string, args ...any)
	Debug(format string, args ...any)
	Warn(format string, args ...any)
	Error(err error)
}

Logger is an interface for logging operations

Jump to

Keyboard shortcuts

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