Documentation
¶
Overview ¶
Package logger provides the process-wide logging API used by croc.
It preserves croc's established logging API while keeping the configured level in an atomic value, so clients and relay servers may adjust logging without racing concurrent log calls.
Index ¶
- func Debug(values ...any)
- func Debugf(format string, values ...any)
- func Error(values ...any)
- func Errorf(format string, values ...any)
- func GetLevel() string
- func Info(values ...any)
- func Infof(format string, values ...any)
- func SetLevel(level string)
- func SetOutput(w io.Writer)
- func Trace(values ...any)
- func Tracef(format string, values ...any)
- func Warn(values ...any)
- func Warnf(format string, values ...any)
- type Logger
- func (l *Logger) Debug(values ...any)
- func (l *Logger) Debugf(format string, values ...any)
- func (l *Logger) Error(values ...any)
- func (l *Logger) Errorf(format string, values ...any)
- func (l *Logger) GetLevel() string
- func (l *Logger) Info(values ...any)
- func (l *Logger) Infof(format string, values ...any)
- func (l *Logger) SetLevel(level string)
- func (l *Logger) SetOutput(w io.Writer)
- func (l *Logger) Trace(values ...any)
- func (l *Logger) Tracef(format string, values ...any)
- func (l *Logger) Warn(values ...any)
- func (l *Logger) Warnf(format string, values ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetLevel ¶
func SetLevel(level string)
SetLevel changes the process-wide minimum level. LOGGER takes precedence.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a concurrency-safe leveled logger.
func New ¶
func New() *Logger
New returns a logger writing to stdout with trace logging enabled, unless LOGGER selects a different minimum level.