Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogEntry ¶
type LogEntry struct {
models.LogEvent
Time string `json:"time"` // Shadowing Timestamp with string
}
LogEntry represents a single log entry parsed from the log file. It mirrors models.LogEvent but is defined here for the service API.
func (LogEntry) MarshalJSON ¶ added in v1.4.60
MarshalJSON customizes JSON marshaling to convert level integer to string
type LogFile ¶
type LogFile struct {
Name string `json:"name"`
Size int64 `json:"size"`
ModTime time.Time `json:"modTime"`
}
LogFile represents a log file in the directory.
type Service ¶
Service provides methods for viewing log files.
func NewService ¶
func NewService(config models.WriterConfiguration) *Service
NewService creates a new LogViewer Service.
func (*Service) GetLogContent ¶
GetLogContent returns parsed log entries from a specific log file. filename: The name of the file to read. limit: Number of lines to read from the end (tail). If <= 0, reads all. levels: List of log levels to filter by (case-insensitive). If empty, returns all.
func (*Service) ListLogFiles ¶
ListLogFiles returns a list of log files in the configured directory.