Help us shape the future of Go! Take the 2026 Go Developer Survey

logger

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogLevel

type LogLevel int
const (
	// Log levels from least to most restrictive
	LevelDebug LogLevel = iota
	LevelInfo
	LevelWarn
	LevelError
	LevelNone
)

type Logger

type Logger struct {
	VerboseMode bool // Legacy flag, maps to Debug level
	// contains filtered or unexported fields
}

func New

func New(out io.Writer, verbose bool, useColors bool) *Logger

New creates a new Logger with the given settings. Normal CLI operation is warning-oriented; verbose mode enables debug and info diagnostics. Callers can explicitly request info with SetLevel("info").

func (*Logger) Debug

func (l *Logger) Debug(format string, args ...interface{})

func (*Logger) Error

func (l *Logger) Error(format string, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(format string, args ...interface{})

func (*Logger) SetLevel

func (l *Logger) SetLevel(levelStr string)

func (*Logger) Warn

func (l *Logger) Warn(format string, args ...interface{})

func (*Logger) WithLevel

func (l *Logger) WithLevel(level LogLevel) *Logger

Jump to

Keyboard shortcuts

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