logging

package
v1.45.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

Close closes the default logger

func Debug

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

Debug logs a debug message using the default logger

func DisableConsoleOutput

func DisableConsoleOutput()

DisableConsoleOutput disables console output for the default logger

func EnableConsoleOutput

func EnableConsoleOutput()

EnableConsoleOutput enables console output for the default logger

func Error

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

Error logs an error message using the default logger

func Info

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

Info logs an info message using the default logger

func SetPrefix

func SetPrefix(prefix string)

SetPrefix sets a prefix for all log messages using the default logger

func Warn

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

Warn logs a warning message using the default logger

Types

type Logger

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

Logger provides structured logging to a file

func InitLogger

func InitLogger(pluginRoot string) (*Logger, error)

InitLogger initializes the default logger If pluginRoot is empty, uses current directory

func NewLogger

func NewLogger(path string) (*Logger, error)

NewLogger creates a new logger that writes to the specified file

func (*Logger) Close

func (l *Logger) Close() error

Close closes the log file

func (*Logger) Debug

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

Debug logs a debug message

func (*Logger) DisableConsoleOutput

func (l *Logger) DisableConsoleOutput()

DisableConsoleOutput disables logging to console

func (*Logger) EnableConsoleOutput

func (l *Logger) EnableConsoleOutput()

EnableConsoleOutput enables logging to console (stderr for errors/warnings, stdout for info/debug)

func (*Logger) Error

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

Error logs an error message

func (*Logger) GetWriter

func (l *Logger) GetWriter() io.Writer

GetWriter returns the underlying writer for the logger

func (*Logger) Info

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

Info logs an info message

func (*Logger) SetPrefix

func (l *Logger) SetPrefix(prefix string)

SetPrefix sets a prefix for all log messages

func (*Logger) Warn

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

Warn logs a warning message

Jump to

Keyboard shortcuts

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