Documentation
¶
Overview ¶
Package logger provides structured logging functionality with support for multiple output modes.
Index ¶
- func Debug(format string, v ...interface{})
- func Error(format string, v ...interface{})
- func ErrorWithStack(err error)
- func Info(format string, v ...interface{})
- func Initialize(cfg Config)
- func InitializeWithWriter(level string, writer *os.File)
- func RequestLog(method, url, sessionID, body string)
- func RequestResponseLog(method, sessionID string, requestData, responseData string)
- func ResponseLog(statusCode int, sessionID, body string)
- func SSEEventLog(eventType, sessionID, data string)
- func Warn(format string, v ...interface{})
- type Config
- type Level
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorWithStack ¶
func ErrorWithStack(err error)
ErrorWithStack logs an error with a stack trace
func Initialize ¶
func Initialize(cfg Config)
Initialize sets up the logger with the specified configuration
func InitializeWithWriter ¶ added in v1.3.0
InitializeWithWriter sets up the logger with the specified level and output writer
func RequestLog ¶
func RequestLog(method, url, sessionID, body string)
RequestLog logs details of an HTTP request
func RequestResponseLog ¶
RequestResponseLog logs a combined request and response log entry
func ResponseLog ¶
ResponseLog logs details of an HTTP response
func SSEEventLog ¶
func SSEEventLog(eventType, sessionID, data string)
SSEEventLog logs details of an SSE event
Types ¶
type Config ¶ added in v1.9.0
type Config struct {
Level string // Log level (debug, info, warn, error)
LogDir string // Directory for log files (optional, defaults to ./logs)
}
Config represents logger configuration
Click to show internal directories.
Click to hide internal directories.