Log: add UTC offset to log timestamps #8

Merged
ClaudeAI merged 1 commits from feature/log-utc-offset into master 3 hours ago
ClaudeAI commented 3 hours ago
Collaborator

Summary

Adds the UTC offset to log timestamps, so log lines are unambiguous across time zones and around daylight-saving changes.

Before: 03 2026-11-26 12:14:55 0x55d1... MOD: message
After: 03 2026-11-26 12:14:55+0200 0x55d1... MOD: message

  • Change in lib/components/base/basicLogCollection.cpp: the timestamp is built once with strftime("%Y-%m-%d %H:%M:%S%z") and used by every mode that includes time (_LOG_TIME, _LOG_TIME_PTR, _LOG_LVL_TIME, _LOG_LVL_TIME_PTR).
  • The rest of the line is unchanged. In GMT mode (USE_LOCAL_TIME_IN_THE_LOG not defined) the offset is +0000.

Testing

  • Ran the real logging code in a small test program under several time zones: UTC +0000, Asia/Jerusalem +0200 (+0300 in summer), America/New_York -0500, Asia/Kolkata +0530. All 8 log modes were checked.
  • Compiles with the Debug86 flags with no errors or warnings.

Note

Scripts or tools that parse the log timestamp with a fixed YYYY-MM-DD HH:MM:SS pattern need to accept the extra +HHMM / -HHMM suffix.

Generated with Claude Code

https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16

## Summary Adds the UTC offset to log timestamps, so log lines are unambiguous across time zones and around daylight-saving changes. Before: `03 2026-11-26 12:14:55 0x55d1... MOD: message` After: `03 2026-11-26 12:14:55+0200 0x55d1... MOD: message` - Change in `lib/components/base/basicLogCollection.cpp`: the timestamp is built once with `strftime("%Y-%m-%d %H:%M:%S%z")` and used by every mode that includes time (`_LOG_TIME`, `_LOG_TIME_PTR`, `_LOG_LVL_TIME`, `_LOG_LVL_TIME_PTR`). - The rest of the line is unchanged. In GMT mode (`USE_LOCAL_TIME_IN_THE_LOG` not defined) the offset is `+0000`. ## Testing - Ran the real logging code in a small test program under several time zones: UTC `+0000`, Asia/Jerusalem `+0200` (`+0300` in summer), America/New_York `-0500`, Asia/Kolkata `+0530`. All 8 log modes were checked. - Compiles with the `Debug86` flags with no errors or warnings. ## Note Scripts or tools that parse the log timestamp with a fixed `YYYY-MM-DD HH:MM:SS` pattern need to accept the extra `+HHMM` / `-HHMM` suffix. Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
ClaudeAI added 1 commit 3 hours ago
61c7e6c896
Log: add UTC offset to log timestamps
ClaudeAI merged commit 1d98fa019d into master 3 hours ago
The pull request has been merged as 1d98fa019d.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.