Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DispatcherLogger ¶
type DispatcherLogger struct {
// contains filtered or unexported fields
}
DispatcherLogger adapts *slog.Logger to the dispatcher.Logger interface.
func NewDispatcherLogger ¶
func NewDispatcherLogger(logger *slog.Logger) *DispatcherLogger
NewDispatcherLogger creates a new DispatcherLogger wrapping a *slog.Logger.
func (*DispatcherLogger) Debug ¶
func (l *DispatcherLogger) Debug(msg string, keysAndValues ...any)
Debug logs a debug message with optional key-value pairs.
func (*DispatcherLogger) Error ¶
func (l *DispatcherLogger) Error(msg string, keysAndValues ...any)
Error logs an error message with optional key-value pairs.
func (*DispatcherLogger) Info ¶
func (l *DispatcherLogger) Info(msg string, keysAndValues ...any)
Info logs an info message with optional key-value pairs.
type MultiHandler ¶
type MultiHandler struct {
// contains filtered or unexported fields
}
MultiHandler fans out log records to multiple handlers. All handlers receive every record.
func NewMultiHandler ¶
func NewMultiHandler(handlers ...slog.Handler) *MultiHandler
NewMultiHandler creates a handler that writes to all provided handlers.
type SlogManager ¶
type SlogManager struct {
// contains filtered or unexported fields
}
SlogManager manages slog-based logging with optional OTel integration.
func NewSlogManager ¶
func NewSlogManager() *SlogManager
NewSlogManager creates a new slog-based logging manager.
func (*SlogManager) Flush ¶
func (m *SlogManager) Flush(ctx context.Context) error
Flush forces a flush of OTel logs if available.
func (*SlogManager) Logger ¶
func (m *SlogManager) Logger() *slog.Logger
Logger returns the configured slog.Logger.
func (*SlogManager) Setup ¶
func (m *SlogManager) Setup(file io.Writer, level string, provider *sdklog.LoggerProvider)
Setup initializes the logging system with file and optional OTel output. If provider is nil, OTel logging is disabled.
func (*SlogManager) WriteLog ¶
func (m *SlogManager) WriteLog(functionName, data, level string)
WriteLog writes a log entry with the specified function name, data, and level. This provides backward compatibility with the old Manager interface.