mirror of
https://github.com/stashapp/stash.git
synced 2025-12-08 09:23:38 +01:00
* Add websocket connection * Add logs to the log page * Make debug color more readable * Remove TODO from front page * Put all log entries in latest first order * Add filtering of log entries by level * Limit log entries and throttle updates * Fix logger not throttling broadcasts * Remove now unnecessary UI-side log throttling * Filter incoming logs by log level * Make log view more terminal-like
23 lines
No EOL
457 B
Go
23 lines
No EOL
457 B
Go
package api
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/stashapp/stash/pkg/logger"
|
|
"github.com/stashapp/stash/pkg/models"
|
|
)
|
|
|
|
func (r *queryResolver) Logs(ctx context.Context) ([]*models.LogEntry, error) {
|
|
logCache := logger.GetLogCache()
|
|
ret := make([]*models.LogEntry, len(logCache))
|
|
|
|
for i, entry := range logCache {
|
|
ret[i] = &models.LogEntry{
|
|
Time: entry.Time,
|
|
Level: getLogLevel(entry.Type),
|
|
Message: entry.Message,
|
|
}
|
|
}
|
|
|
|
return ret, nil
|
|
} |