Commit Graph

3 Commits

Author SHA1 Message Date
Jeff Squyres
31d4c9c84f fix: use ISO 8601 format for log timestamps [AI generated]
Change log timestamps from the custom format to ISO 8601 with UTC
indicator:

  Before: 2026-05-14 (10:31:47) | DEBUG: ...
  After:  2026-05-14T10:31:47Z | DEBUG: ...

The previous format used parentheses around the time and omitted any
timezone indicator, making timestamps ambiguous. The logger uses
std::chrono::system_clock which measures time since Unix epoch (UTC
on all platforms), but the old format did not communicate this.

ISO 8601 with the Z suffix is an unambiguous, universally-recognized
format parseable by standard functions across languages:
- C++ (C++20): std::chrono::from_stream(ss, "%FT%TZ", tp)
- C: strptime(s, "%Y-%m-%dT%H:%M:%SZ", &tm)
- Python: datetime.fromisoformat("2026-05-14T10:31:47Z")

This matters for correlating btop log events with system logs (e.g.,
macOS pmset power events) that use local time with explicit timezone
offsets.
2026-05-17 16:46:24 -04:00
aristocratos
112422b4c4 Ignore warning for -Wunused-result in ~DropPrivilegeGuard() for GCC 2026-02-14 21:00:33 +01:00
Steffen Winter
fd9cd479ad refactor: use fmt::format like interface for logger
This will only allocate the log message if a log file exists and the log
level is enabled. The interface forwards it's arguments to fmt::format.
This gets also rid of some global state and hides it in the btop_log.cpp
translation unit.

Closes: https://github.com/aristocratos/btop/issues/1347
2026-01-04 12:11:21 +01:00