Documentation
¶
Index ¶
- func Critical(format string, args ...interface{})
- func Debug(format string, args ...interface{})
- func DebugStart(logger *Logger, operation string, format string, args ...interface{}) func(error)
- func DebugStartBootstrap(logger *BootstrapLogger, operation string, format string, args ...interface{}) func(error)
- func DebugStep(logger *Logger, operation string, format string, args ...interface{})
- func DebugStepBootstrap(logger *BootstrapLogger, operation string, format string, args ...interface{})
- func Error(format string, args ...interface{})
- func Fatal(exitCode types.ExitCode, format string, args ...interface{})
- func Info(format string, args ...interface{})
- func SetDefaultLogger(logger *Logger)
- func Skip(format string, args ...interface{})
- func Step(format string, args ...interface{})
- func Warning(format string, args ...interface{})
- type BootstrapLogger
- func (b *BootstrapLogger) Debug(format string, args ...interface{})
- func (b *BootstrapLogger) Error(format string, args ...interface{})
- func (b *BootstrapLogger) Flush(logger *Logger)
- func (b *BootstrapLogger) Info(format string, args ...interface{})
- func (b *BootstrapLogger) Printf(format string, args ...interface{})
- func (b *BootstrapLogger) Println(message string)
- func (b *BootstrapLogger) SetLevel(level types.LogLevel)
- func (b *BootstrapLogger) SetMirrorLogger(logger *Logger)
- func (b *BootstrapLogger) Warning(format string, args ...interface{})
- type Logger
- func (l *Logger) AppendRaw(message string)
- func (l *Logger) CloseLogFile() error
- func (l *Logger) Critical(format string, args ...interface{})
- func (l *Logger) Debug(format string, args ...interface{})
- func (l *Logger) Error(format string, args ...interface{})
- func (l *Logger) ErrorCount() int64
- func (l *Logger) Fatal(exitCode types.ExitCode, format string, args ...interface{})
- func (l *Logger) GetLevel() types.LogLevel
- func (l *Logger) GetLogFilePath() string
- func (l *Logger) HasErrors() bool
- func (l *Logger) HasWarnings() bool
- func (l *Logger) Info(format string, args ...interface{})
- func (l *Logger) IssueLines() []string
- func (l *Logger) OpenLogFile(logPath string) error
- func (l *Logger) Phase(format string, args ...interface{})
- func (l *Logger) SetExitFunc(fn func(int))
- func (l *Logger) SetLevel(level types.LogLevel)
- func (l *Logger) SetOutput(w io.Writer)
- func (l *Logger) Skip(format string, args ...interface{})
- func (l *Logger) Step(format string, args ...interface{})
- func (l *Logger) UsesColor() bool
- func (l *Logger) Warning(format string, args ...interface{})
- func (l *Logger) WarningCount() int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Critical ¶
func Critical(format string, args ...interface{})
Critical writes a critical log using the default logger.
func Debug ¶
func Debug(format string, args ...interface{})
Debug writes a debug log using the default logger.
func DebugStart ¶ added in v0.12.5
DebugStart logs a standardized debug start line and returns a function that logs the end status (ok/error) with duration.
func DebugStartBootstrap ¶ added in v0.12.5
func DebugStartBootstrap(logger *BootstrapLogger, operation string, format string, args ...interface{}) func(error)
DebugStartBootstrap logs a standardized debug start line and returns a function that logs the end status (ok/error) with duration.
func DebugStep ¶ added in v0.12.5
DebugStep logs a standardized debug progress line for an operation.
func DebugStepBootstrap ¶ added in v0.12.5
func DebugStepBootstrap(logger *BootstrapLogger, operation string, format string, args ...interface{})
DebugStepBootstrap logs a standardized debug progress line for an operation.
func Error ¶
func Error(format string, args ...interface{})
Error writes an error log using the default logger.
func Info ¶
func Info(format string, args ...interface{})
Info writes an informational log using the default logger
func SetDefaultLogger ¶
func SetDefaultLogger(logger *Logger)
SetDefaultLogger sets the default logger.
func Skip ¶
func Skip(format string, args ...interface{})
Skip writes a SKIP log using the default logger.
Types ¶
type BootstrapLogger ¶
type BootstrapLogger struct {
// contains filtered or unexported fields
}
BootstrapLogger accumulates logs generated before the main logger is initialized, so they can be flushed into the final log.
func NewBootstrapLogger ¶
func NewBootstrapLogger() *BootstrapLogger
NewBootstrapLogger creates a new bootstrap logger with INFO level by default.
func (*BootstrapLogger) Debug ¶
func (b *BootstrapLogger) Debug(format string, args ...interface{})
Debug records a debug message without printing it to the console.
func (*BootstrapLogger) Error ¶
func (b *BootstrapLogger) Error(format string, args ...interface{})
Error records an early error message (stderr).
func (*BootstrapLogger) Flush ¶
func (b *BootstrapLogger) Flush(logger *Logger)
Flush flushes accumulated entries into the main logger (only the first time).
func (*BootstrapLogger) Info ¶
func (b *BootstrapLogger) Info(format string, args ...interface{})
Info logs an early informational message.
func (*BootstrapLogger) Printf ¶
func (b *BootstrapLogger) Printf(format string, args ...interface{})
Printf records a formatted line as raw.
func (*BootstrapLogger) Println ¶
func (b *BootstrapLogger) Println(message string)
Println records a raw line (used for banners/text without a header).
func (*BootstrapLogger) SetLevel ¶
func (b *BootstrapLogger) SetLevel(level types.LogLevel)
SetLevel updates the minimum level used during 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 records an early warning message (printed to stderr).
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger handles application logging.
func GetDefaultLogger ¶
func GetDefaultLogger() *Logger
GetDefaultLogger returns the default 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) AppendRaw ¶ added in v0.11.3
AppendRaw writes a raw log line directly to the log file (if any) without emitting it to stdout. It is primarily used by the bootstrap logger to persist early banner/output without duplicating it on console.
func (*Logger) CloseLogFile ¶
CloseLogFile closes the log file (call after notifications).
func (*Logger) ErrorCount ¶ added in v0.13.4
ErrorCount returns the total number of ERROR/CRITICAL log entries emitted.
func (*Logger) GetLogFilePath ¶
GetLogFilePath returns the path of the currently open log file (or "" if none).
func (*Logger) HasErrors ¶
HasErrors returns true if at least one error or critical message was logged.
func (*Logger) HasWarnings ¶
HasWarnings returns true if at least one warning was logged.
func (*Logger) IssueLines ¶ added in v0.13.4
IssueLines returns a copy of captured WARNING/ERROR/CRITICAL log lines in chronological order. Intended for end-of-run summaries.
func (*Logger) OpenLogFile ¶
OpenLogFile opens a log file and starts real-time writing.
func (*Logger) SetExitFunc ¶
SetExitFunc allows customizing the exit function (useful for tests). If fn is nil, it restores os.Exit.
func (*Logger) Skip ¶
Skip writes an informational log with SKIP label (for disabled/ignored elements)
func (*Logger) Step ¶
Step writes an informational log with STEP label (to highlight sequential activities)
func (*Logger) WarningCount ¶ added in v0.13.4
WarningCount returns the total number of WARNING log entries emitted.