feat(libc): add optional log timestamps #5860

Merged
MarcZX10 merged 1 commit from upstream-pr/5860 into main 2026-10-14 14:38:30 +00:00
MarcZX10 commented 2026-10-14 13:55:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T13:55:45Z.


What

Add opt-in elapsed-time prefixes to lines written through WriteLogLine. Set APS5_LOG_TIMESTAMPS to enable the monotonic timestamp; it is disabled by default. The prefix and message are emitted in one write so concurrent lines stay together. The default path keeps the existing output unchanged.

Add a separate CTest case for timestamped output, including short and long lines and the no-argument logging macro. This is the timestamp-prefix topic from #3815; the other remaining topics stay separate.

Tested

  • Linux x86-64, GCC 12.2: directly compiled core/libs/tests/LogMacros.cpp with -std=c++20 -Wall -Wextra -Werror -pthread; both default and timestamped modes passed.
  • python3 tools/check_conventions.py --base upstream/main passed.
  • git diff --check passed.
  • Full project build and Windows runtime test were not run locally.

Checklist

  • Based on current main; no other open PR implements the same logging behavior
  • One topic per PR
  • No code comments added
  • No unimplemented exports or silent stubs changed
  • No investigation notes or images added
  • No third-party code added
  • Generic logging behavior
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Codex); author responsible for the change
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4858997698 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5860). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-14T13:55:45Z. --- ### What Add opt-in elapsed-time prefixes to lines written through `WriteLogLine`. Set `APS5_LOG_TIMESTAMPS` to enable the monotonic timestamp; it is disabled by default. The prefix and message are emitted in one write so concurrent lines stay together. The default path keeps the existing output unchanged. Add a separate CTest case for timestamped output, including short and long lines and the no-argument logging macro. This is the timestamp-prefix topic from #3815; the other remaining topics stay separate. ### Tested - Linux x86-64, GCC 12.2: directly compiled `core/libs/tests/LogMacros.cpp` with `-std=c++20 -Wall -Wextra -Werror -pthread`; both default and timestamped modes passed. - `python3 tools/check_conventions.py --base upstream/main` passed. - `git diff --check` passed. - Full project build and Windows runtime test were not run locally. ### Checklist - [x] Based on current `main`; no other open PR implements the same logging behavior - [x] One topic per PR - [x] No code comments added - [x] No unimplemented exports or silent stubs changed - [x] No investigation notes or images added - [x] No third-party code added - [x] Generic logging behavior - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes (Codex); author responsible for the change
adriadam10 commented 2026-10-14 14:06:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T14:06:30Z.


Checked the prefix/long-line paths in WriteLogLine, built LogMacros.cpp with -Wall -Wextra -Werror: default and timestamps modes pass, and the timestamps case fails against main's header. Merging once the full build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6170263412 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5860#issuecomment-6170263412). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T14:06:30Z. --- Checked the prefix/long-line paths in `WriteLogLine`, built `LogMacros.cpp` with `-Wall -Wextra -Werror`: default and `timestamps` modes pass, and the `timestamps` case fails against `main`'s header. Merging once the full build is green.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!5860
No description provided.