diff --git a/godump b/godump deleted file mode 160000 index 9a41715..0000000 --- a/godump +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9a417155fcbcc106011d2efc70dfae8ff804ae1e diff --git a/internal/logger/logger.go b/internal/logger/logger.go index 0b5f776..52d537f 100644 --- a/internal/logger/logger.go +++ b/internal/logger/logger.go @@ -61,19 +61,9 @@ func Init(broadcast func(string, interface{})) { Broadcast = broadcast ringBuffer = ring.New(100) log.SetOutput(&customWriter{stdout: os.Stdout}) - // Remove timestamp from log format since we add it in LogEntry or we can let log package add it - // Wait, standard log adds timestamp. If standard log adds timestamp, our `msg` will contain the timestamp. - // But `LogEntry` has a `Timestamp` field for the JSON. - // It's cleaner to remove the standard log flags so `msg` is just the message, and let stdout print the plain msg? - // But stdout wouldn't have timestamps then unless we format it ourselves. - // Let's just remove log flags and format it ourselves for stdout! log.SetFlags(0) } -// Since we removed log flags, we need to handle stdout formatting in Write if we want timestamps in stdout. -// Actually, let's keep the timestamp in stdout, we can modify customWriter.Write to prepend the timestamp to stdout. -// We'll update the writer in a moment if needed. - func GetRecentLogs() []LogEntry { bufferMu.Lock() defer bufferMu.Unlock() diff --git a/internal/queue/worker.go b/internal/queue/worker.go index a96fc89..b1a4f42 100644 --- a/internal/queue/worker.go +++ b/internal/queue/worker.go @@ -197,10 +197,6 @@ func (m *Manager) runEncoder(job db.Job) error { scanner := bufio.NewScanner(stderr) scanner.Split(bufio.ScanLines) - // Some ffmpeg progress output uses carriage returns instead of newlines - // We handle standard lines, to get a more robust carriage return split, we could implement a custom split function. - // For simplicity, ScanLines usually catches 'time=' lines well enough if they have \n. - // Let's use a custom split to handle '\r' as well. scanner.Split(func(data []byte, atEOF bool) (advance int, token []byte, err error) { if atEOF && len(data) == 0 { return 0, nil, nil