fix: show actual timestamps in debug log viewer
The Naplóviewer was showing relative times like '3586mp' (seconds ago) which were also negative due to timezone mismatch — parseLine used time.Parse (UTC) but log.LstdFlags outputs local time. Now: - parseLine uses time.ParseInLocation with time.Local - fmtTime JS shows absolute HH:MM:SS (or MM-DD HH:MM:SS for old entries) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -111,8 +111,9 @@ func parseLine(line string) LogEntry {
|
||||
}
|
||||
|
||||
// Try to parse timestamp: "2006/01/02 15:04:05"
|
||||
// Use Local timezone because Go's log.LstdFlags outputs in local time.
|
||||
if len(line) >= 19 {
|
||||
if t, err := time.Parse("2006/01/02 15:04:05", line[:19]); err == nil {
|
||||
if t, err := time.ParseInLocation("2006/01/02 15:04:05", line[:19], time.Local); err == nil {
|
||||
entry.Timestamp = t
|
||||
rest := line[19:]
|
||||
if len(rest) > 0 && rest[0] == ' ' {
|
||||
|
||||
Reference in New Issue
Block a user