Zeitstempel und lesbares Format fürs Ausführen-Log #5
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DasAoD/imapfilter-ui!5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/log-timestamps-readable"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Was
Das Log unter „▶️ Ausführen" war bisher 1:1 die rohe
imapfilter-Ausgabe — ganz ohne Zeitstempel und mit sehr technischen Zeilen wie:Jetzt:
[YYYY-MM-DD HH:MM:SS]pro Lauf (Dispatcher wie manueller Klick auf „imapfilter starten"), damit erkennbar ist, wann zuletzt Mails verschoben wurden.N messages moved from user@host/A to user@host/B.→📬 N Mail(s) verschoben: A → B. Warnungen/Fehler von imapfilter selbst werden mit ⚠️ markiert statt unauffällig dazwischenzustehen.(manuell)-Markierung) in derselben Logdatei wie die Cron-Läufe.Wie
cron/dispatcher.php: Ausgabe wird jetzt überexec()s$output-Array eingesammelt statt per Shell-Redirect direkt in die Logdatei geschrieben, dann mit einem Zeitstempel pro Lauf per PHP an die Datei angehängt.public/api/run.php: manuelle Läufe schreiben jetzt genauso ins persistente Log.public/assets/app.js:loadLog()formatiert jede Zeile fürs Anzeigen um (formatLogLine()), lässt die Rohdatei aber unangetastet.Review
code-reviewerbestätigt: keine Verhaltensänderung beim Exit-Code ($codekam vorher wie nachher vomexec()-Kommando selbst, die Shell-Umleitung hatte darauf nie Einfluss), sauberes Array-Reset pro Nutzer in der Dispatcher-Schleife, Regex robust für die realistischen Fälle, kein XSS (nurtextContent, nieinnerHTML). Zwei kleine Punkte behoben: leere Log-Zeilen erzeugten einen inhaltsleeren Zeitstempel-Eintrag (jetzt rausgefiltert), und manuelle Lauf-Zeilen hatten ein doppeltes Emoji (🖱️ + 📬) — vereinfacht zu einem Textzusatz „· manueller Lauf".🤖 Generated with Claude Code
- imapfilter's own output has no timestamps at all ("N messages moved from user@host/A to user@host/B.") and both the cron dispatcher and manual runs wrote it via shell redirect with no time reference - cron/dispatcher.php: capture imapfilter's output via exec()'s $output array instead of a shell "2>&1 >> logfile" redirect, then write it to the log with one timestamp per run — also means $code now reflects imapfilter's real exit status directly (no behavior change there, just no longer routed through a shell redirect) - public/api/run.php: manual "imapfilter starten" runs now get persisted to the same log file the same way (tagged "(manuell)"), instead of only flashing transiently in the browser and never showing up on reload - public/assets/app.js: loadLog() reformats each line for display — timestamp kept, "N messages moved from user@host/A to user@host/B." collapsed to "N Mail(s) verschoben: A → B", imapfilter's own diagnostic lines prefixed with ⚠️ instead of looking identical to a normal move. The stored log file itself is untouched, only the rendered view is prettified. Co-authored-by: Claude <claude@anthropic.com>- Filter out blank lines from imapfilter's output before writing to the log — previously a run with an empty output line still produced a bare "[timestamp]" entry with no content - Drop the redundant 🖱️ emoji on manual-run lines (already carries the move emoji or a warning marker); just append "· manueller Lauf" instead Co-authored-by: Claude <claude@anthropic.com>