fifo logs

This commit is contained in:
2025-08-20 14:19:12 +02:00
parent 83d6aa10cb
commit fb5d408a01
8 changed files with 202 additions and 53 deletions

View File

@@ -20,9 +20,10 @@ import (
type Application struct {
masterLock sync.Mutex
logLock sync.Mutex
logFile *os.File // file to write logs to, if set
logList []dataext.Triple[string, string, func(string) string]
logLock sync.Mutex
logFile *os.File // file to write logs to, if set
logList []LogMessage
logBroadcaster *dataext.PubSub[string, LogMessage]
config Config
@@ -55,7 +56,8 @@ func NewApplication() *Application {
app := &Application{
masterLock: sync.Mutex{},
logLock: sync.Mutex{},
logList: make([]dataext.Triple[string, string, func(string) string], 0, 1024),
logList: make([]LogMessage, 0, 1024),
logBroadcaster: dataext.NewPubSub[string, LogMessage](128),
uploadRunning: syncext.NewAtomicBool(false),
trayReady: syncext.NewAtomicBool(false),
syncLoopRunning: syncext.NewAtomicBool(false),