Documentation
¶
Overview ¶
Package logging provides a standardized logging interface for CUDly. This package wraps the standard log package and provides structured logging capabilities with log levels.
Index ¶
- func Debug(msg string)
- func Debugf(format string, args ...interface{})
- func Error(msg string)
- func Errorf(format string, args ...interface{})
- func Info(msg string)
- func Infof(format string, args ...interface{})
- func SetLevel(level string)
- func SetLevelValue(level Level)
- func SetOutput(w io.Writer) io.Writer
- func Warn(msg string)
- func Warnf(format string, args ...interface{})
- type Config
- type Level
- type Logger
- func (l *Logger) Debug(msg string)
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Error(msg string)
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Info(msg string)
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) Warn(msg string)
- func (l *Logger) Warnf(format string, args ...interface{})
- func (l *Logger) With(key string, value interface{}) *Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf logs a formatted debug message using the default logger.
func Errorf ¶
func Errorf(format string, args ...interface{})
Errorf logs a formatted error message using the default logger.
func Infof ¶
func Infof(format string, args ...interface{})
Infof logs a formatted info message using the default logger.
func SetLevelValue ¶
func SetLevelValue(level Level)
SetLevelValue sets the logging level using a Level value.
func SetOutput ¶
SetOutput redirects the default logger's output to w and returns the previous io.Writer so callers can restore it (e.g. in a test t.Cleanup). The default logger binds os.Stderr at init() time, so reassigning the os.Stderr variable does not redirect it; this is the supported seam for capturing default-logger output in tests.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger provides structured logging capabilities.
level is stored as an atomic.Int32 so that SetLevel/SetLevelValue (called at runtime, sometimes after worker goroutines have launched) and the level reads performed by every Debug/Info/Warn/Error call are race-free under the concurrent fan-out, which logs from many goroutines.
func GetDefaultLogger ¶
func GetDefaultLogger() *Logger
GetDefaultLogger returns the default logger instance.