Documentation
¶
Index ¶
- func Debug(format string, args ...interface{})
- func Error(format string, args ...interface{})
- func Fatal(format string, args ...interface{})
- func Info(format string, args ...interface{})
- func SetOutput(output *os.File)
- func Warn(format string, args ...interface{})
- type LogLevel
- type LogWriter
- type Logger
- func (l *Logger) Debug(format string, args ...interface{})
- func (l *Logger) Error(format string, args ...interface{})
- func (l *Logger) Fatal(format string, args ...interface{})
- func (l *Logger) GetWireGuardLogger(prepend string) *WireGuardLogger
- func (l *Logger) Info(format string, args ...interface{})
- func (l *Logger) SetLevel(level LogLevel)
- func (l *Logger) SetOutput(output *os.File)
- func (l *Logger) Warn(format string, args ...interface{})
- type StandardWriter
- type WireGuardLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LogWriter ¶ added in v1.8.0
type LogWriter interface {
// Write writes a log message with the given level, timestamp, and formatted message
Write(level LogLevel, timestamp time.Time, message string)
}
LogWriter is an interface for writing log messages Implement this interface to create custom log backends (OS log, syslog, etc.)
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger struct holds the logger instance
func NewLogger ¶
func NewLogger() *Logger
NewLogger creates a new logger instance with the default StandardWriter
func NewLoggerWithWriter ¶ added in v1.8.0
NewLoggerWithWriter creates a new logger instance with a custom LogWriter
func (*Logger) GetWireGuardLogger ¶ added in v1.8.0
func (l *Logger) GetWireGuardLogger(prepend string) *WireGuardLogger
GetWireGuardLogger returns a WireGuard-compatible logger that writes to the newt logger The prepend string is added as a prefix to all log messages
type StandardWriter ¶ added in v1.8.0
type StandardWriter struct {
// contains filtered or unexported fields
}
StandardWriter is the default log writer that writes to an io.Writer
func NewStandardWriter ¶ added in v1.8.0
func NewStandardWriter() *StandardWriter
NewStandardWriter creates a new standard writer with the default configuration
func (*StandardWriter) SetOutput ¶ added in v1.8.0
func (w *StandardWriter) SetOutput(output *os.File)
SetOutput sets the output destination
Click to show internal directories.
Click to hide internal directories.