Documentation
¶
Overview ¶
Package logger provides logging functionality with execution isolation. Each execution maintains a separate log stream identified by executionID.
Index ¶
- type LogEntry
- type LogLevel
- type Logger
- type MemoryLogger
- func (m *MemoryLogger) Clear()
- func (m *MemoryLogger) Count() int
- func (m *MemoryLogger) Debug(executionID string, message string)
- func (m *MemoryLogger) Entries(executionID string) []LogEntry
- func (m *MemoryLogger) EntriesByLevel(executionID string, level LogLevel) []LogEntry
- func (m *MemoryLogger) EntriesPaginated(executionID string, limit, offset int) ([]LogEntry, int64)
- func (m *MemoryLogger) Error(executionID string, message string)
- func (m *MemoryLogger) Info(executionID string, message string)
- func (m *MemoryLogger) Log(executionID string, level LogLevel, message string)
- func (m *MemoryLogger) String() string
- func (m *MemoryLogger) Warn(executionID string, message string)
- type SQLiteLogger
- func (s *SQLiteLogger) Debug(executionID string, message string)
- func (s *SQLiteLogger) Entries(executionID string) []LogEntry
- func (s *SQLiteLogger) EntriesByExecutionID(executionID string) []LogEntry
- func (s *SQLiteLogger) EntriesByLevel(executionID string, level LogLevel) []LogEntry
- func (s *SQLiteLogger) EntriesPaginated(executionID string, limit, offset int) ([]LogEntry, int64)
- func (s *SQLiteLogger) Error(executionID string, message string)
- func (s *SQLiteLogger) Info(executionID string, message string)
- func (s *SQLiteLogger) Log(executionID string, level LogLevel, message string)
- func (s *SQLiteLogger) Warn(executionID string, message string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface {
Log(executionID string, level LogLevel, message string)
Info(executionID string, message string)
Debug(executionID string, message string)
Warn(executionID string, message string)
Error(executionID string, message string)
Entries(executionID string) []LogEntry
EntriesPaginated(executionID string, limit, offset int) ([]LogEntry, int64)
}
Logger is an interface for logging operations executionID is used to isolate logs for each function execution
type MemoryLogger ¶
type MemoryLogger struct {
// contains filtered or unexported fields
}
MemoryLogger is an in-memory implementation of Logger
func NewMemoryLogger ¶
func NewMemoryLogger() *MemoryLogger
NewMemoryLogger creates a new in-memory logger
func (*MemoryLogger) Count ¶
func (m *MemoryLogger) Count() int
Count returns the total number of log entries
func (*MemoryLogger) Debug ¶
func (m *MemoryLogger) Debug(executionID string, message string)
Debug logs a debug message
func (*MemoryLogger) Entries ¶
func (m *MemoryLogger) Entries(executionID string) []LogEntry
Entries returns all log entries for the specified executionID
func (*MemoryLogger) EntriesByLevel ¶
func (m *MemoryLogger) EntriesByLevel(executionID string, level LogLevel) []LogEntry
EntriesByLevel returns all log entries with the specified executionID and level
func (*MemoryLogger) EntriesPaginated ¶
func (m *MemoryLogger) EntriesPaginated(executionID string, limit, offset int) ([]LogEntry, int64)
EntriesPaginated returns paginated log entries for the specified executionID
func (*MemoryLogger) Error ¶
func (m *MemoryLogger) Error(executionID string, message string)
Error logs an error message
func (*MemoryLogger) Info ¶
func (m *MemoryLogger) Info(executionID string, message string)
Info logs an informational message
func (*MemoryLogger) Log ¶
func (m *MemoryLogger) Log(executionID string, level LogLevel, message string)
Log records a log entry with the specified executionID, level and message
func (*MemoryLogger) String ¶
func (m *MemoryLogger) String() string
String returns a formatted string representation of all log entries
func (*MemoryLogger) Warn ¶
func (m *MemoryLogger) Warn(executionID string, message string)
Warn logs a warning message
type SQLiteLogger ¶
type SQLiteLogger struct {
// contains filtered or unexported fields
}
SQLiteLogger is a SQLite-backed implementation of Logger
func NewSQLiteLogger ¶
func NewSQLiteLogger(db *sql.DB) *SQLiteLogger
NewSQLiteLogger creates a new SQLite-backed logger
func (*SQLiteLogger) Debug ¶
func (s *SQLiteLogger) Debug(executionID string, message string)
Debug logs a debug message
func (*SQLiteLogger) Entries ¶
func (s *SQLiteLogger) Entries(executionID string) []LogEntry
Entries returns all log entries for the specified executionID
func (*SQLiteLogger) EntriesByExecutionID ¶
func (s *SQLiteLogger) EntriesByExecutionID(executionID string) []LogEntry
EntriesByExecutionID returns all log entries for the specified executionID
func (*SQLiteLogger) EntriesByLevel ¶
func (s *SQLiteLogger) EntriesByLevel(executionID string, level LogLevel) []LogEntry
EntriesByLevel returns all log entries with the specified executionID and level
func (*SQLiteLogger) EntriesPaginated ¶
func (s *SQLiteLogger) EntriesPaginated(executionID string, limit, offset int) ([]LogEntry, int64)
EntriesPaginated returns paginated log entries for the specified executionID
func (*SQLiteLogger) Error ¶
func (s *SQLiteLogger) Error(executionID string, message string)
Error logs an error message
func (*SQLiteLogger) Info ¶
func (s *SQLiteLogger) Info(executionID string, message string)
Info logs an informational message
func (*SQLiteLogger) Log ¶
func (s *SQLiteLogger) Log(executionID string, level LogLevel, message string)
Log records a log entry with the specified executionID, level and message
func (*SQLiteLogger) Warn ¶
func (s *SQLiteLogger) Warn(executionID string, message string)
Warn logs a warning message