logging

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Critical

func Critical(format string, args ...interface{})

Critical scrive un log critico usando il logger di default

func Debug

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

Debug scrive un log di debug usando il logger di default

func Error

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

Error scrive un log di errore usando il logger di default

func Fatal

func Fatal(exitCode types.ExitCode, format string, args ...interface{})

Fatal scrive un log critico ed esce con il codice specificato

func Info

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

Info scrive un log informativo usando il logger di default

func SetDefaultLogger

func SetDefaultLogger(logger *Logger)

SetDefaultLogger imposta il logger di default

func Skip

func Skip(format string, args ...interface{})

Skip scrive un log SKIP usando il logger di default

func Step

func Step(format string, args ...interface{})

Step scrive un log STEP usando il logger di default

func Warning

func Warning(format string, args ...interface{})

Warning scrive un log di warning usando il logger di default

Types

type BootstrapLogger

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

BootstrapLogger accumula i log generati prima che il logger principale sia inizializzato, così da poterli riversare nel log finale.

func NewBootstrapLogger

func NewBootstrapLogger() *BootstrapLogger

NewBootstrapLogger crea un nuovo bootstrap logger con livello INFO di default.

func (*BootstrapLogger) Debug

func (b *BootstrapLogger) Debug(format string, args ...interface{})

Debug registra un messaggio di debug senza stamparlo a console.

func (*BootstrapLogger) Error

func (b *BootstrapLogger) Error(format string, args ...interface{})

Error registra un messaggio di errore precoce (stderr).

func (*BootstrapLogger) Flush

func (b *BootstrapLogger) Flush(logger *Logger)

Flush riversa le entry accumulate nel logger principale (solo la prima volta).

func (*BootstrapLogger) Info

func (b *BootstrapLogger) Info(format string, args ...interface{})

Info registra un messaggio informativo precoce.

func (*BootstrapLogger) Printf

func (b *BootstrapLogger) Printf(format string, args ...interface{})

Printf registra una riga formattata come raw.

func (*BootstrapLogger) Println

func (b *BootstrapLogger) Println(message string)

Println registra una riga “raw” (usata per banner/testo senza header).

func (*BootstrapLogger) SetLevel

func (b *BootstrapLogger) SetLevel(level types.LogLevel)

SetLevel aggiorna il livello minimo che verrà usato al flush.

func (*BootstrapLogger) SetMirrorLogger

func (b *BootstrapLogger) SetMirrorLogger(logger *Logger)

SetMirrorLogger forwards every bootstrap message to the provided logger.

func (*BootstrapLogger) Warning

func (b *BootstrapLogger) Warning(format string, args ...interface{})

Warning registra un messaggio di warning precoce (stampato su stderr).

type Logger

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

Logger gestisce il logging dell'applicazione

func GetDefaultLogger

func GetDefaultLogger() *Logger

GetDefaultLogger restituisce il logger di default

func New

func New(level types.LogLevel, useColor bool) *Logger

New crea un nuovo logger

func StartSessionLogger

func StartSessionLogger(flow string, level types.LogLevel, useColor bool) (*Logger, string, func(), error)

StartSessionLogger creates a new logger instance that writes to a real-time log file under /tmp/proxsave. The caller receives the configured logger, the absolute log path, and a cleanup function that must be invoked when the session completes.

func (*Logger) CloseLogFile

func (l *Logger) CloseLogFile() error

CloseLogFile chiude il file di log (da chiamare dopo le notifiche)

func (*Logger) Critical

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

Critical scrive un log critico

func (*Logger) Debug

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

Debug scrive un log di debug

func (*Logger) Error

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

Error scrive un log di errore

func (*Logger) Fatal

func (l *Logger) Fatal(exitCode types.ExitCode, format string, args ...interface{})

Fatal scrive un log critico ed esce con il codice specificato

func (*Logger) GetLevel

func (l *Logger) GetLevel() types.LogLevel

GetLevel restituisce il livello corrente

func (*Logger) GetLogFilePath

func (l *Logger) GetLogFilePath() string

GetLogFilePath restituisce il path del file di log attualmente aperto (o "" se nessuno)

func (*Logger) HasErrors

func (l *Logger) HasErrors() bool

HasErrors returns true if at least one error or critical message was logged.

func (*Logger) HasWarnings

func (l *Logger) HasWarnings() bool

HasWarnings returns true if at least one warning was logged.

func (*Logger) Info

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

Info scrive un log informativo

func (*Logger) OpenLogFile

func (l *Logger) OpenLogFile(logPath string) error

OpenLogFile apre un file di log e inizia la scrittura real-time

func (*Logger) Phase

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

Phase scrive un log informativo con etichetta PHASE

func (*Logger) SetExitFunc

func (l *Logger) SetExitFunc(fn func(int))

SetExitFunc allows customizing the exit function (useful for tests). If fn is nil, it restores os.Exit.

func (*Logger) SetLevel

func (l *Logger) SetLevel(level types.LogLevel)

SetLevel imposta il livello di logging

func (*Logger) SetOutput

func (l *Logger) SetOutput(w io.Writer)

SetOutput imposta l'output writer del logger

func (*Logger) Skip

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

Skip scrive un log informativo con etichetta SKIP (per elementi disabilitati/ignorati)

func (*Logger) Step

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

Step scrive un log informativo con etichetta STEP (per evidenziare attività sequenziali)

func (*Logger) UsesColor

func (l *Logger) UsesColor() bool

UsesColor returns whether color output is enabled.

func (*Logger) Warning

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

Warning scrive un log di warning

Jump to

Keyboard shortcuts

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