Skip to content

fix(process_group_manager): standardize ProcessInfoNode logs - #609

Open
shegazyy wants to merge 4 commits into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:fix/standardize-process-info-node-logs
Open

shegazyy wants to merge 4 commits into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:fix/standardize-process-info-node-logs

Conversation

@shegazyy

@shegazyy shegazyy commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Add a private logId() helper that renders a consistent identity string, "Name: , PID: ", and use it at all 19 call sites in ProcessInfoNode that previously formatted process identity differently ("process X", "process (X)", "process X pid Y", "pid Y (X)", ...).

Also fixes a bug at startProcess(): a log statement streamed the raw 'this' pointer instead of process identity, which prints as "1"/"true" under the fallback console logger instead of anything useful.

Two logs that previously omitted process identity entirely (file-wait error, PID-map insertion failure) now include it too.

fixes #570

@danth

danth commented Sep 9, 2026

Copy link
Copy Markdown
Member

Maybe it would be good for readability if we always put the identifier at the beginning of the message?

control_client: PID 73: started
control_client: PID 73: reported running
control_client: PID 73: terminated with exit code 1

@github-actions

Copy link
Copy Markdown
Contributor

Documentation preview for this pull request is available at:
pr-609: https://eclipse-score.github.io/lifecycle/pr-609/

…-score#570)

Add a private logId() helper that renders a consistent identity string,
"Name: <name>, PID: <pid>", and use it at all 19 call sites in
ProcessInfoNode that previously formatted process identity differently
("process X", "process (X)", "process X pid Y", "pid Y (X)", ...).

Also fixes a bug at startProcess(): a log statement streamed the raw
'this' pointer instead of process identity, which prints as "1"/"true"
under the fallback console logger instead of anything useful.

Two logs that previously omitted process identity entirely (file-wait
error, PID-map insertion failure) now include it too.
Per review feedback (NicolasFussberger): logId() returned std::string,
heap-allocating on every log call, which must be avoided after
initialization.

- logId() now returns ProcessLogId, a small trivially-copyable struct
  (IdentifierHash + osal::ProcessID) instead of building a std::string.
  Formatting happens only when a log line is actually printed, via
  operator<< overloads for both std::ostream and score::mw::log::LogStream
  (mirroring the exact dual-overload pattern IdentifierHash already
  uses for the two supported logging backends). No heap allocation.

Per review feedback (danth): for readability, the process identity
should consistently lead every log message rather than appearing in
the middle or at the end.

- Reordered all 19 call sites so every one now reads
  `LM_LOG_*() << logId() << "<description>";`, replacing the previous
  mixed styles ("Setting up alive supervision for" << logId(),
  "Starting" << logId() << "from executable" ..., etc.).
@shegazyy
shegazyy force-pushed the fix/standardize-process-info-node-logs branch from 14369ea to d783f27 Compare September 14, 2026 10:01
@shegazyy

Copy link
Copy Markdown
Contributor Author

@NicolasFussberger changes are applied, and ready for review whenever you have the time

Share the "Name:<name>, PID:<pid>" formatting between the std::ostream
and score::mw::log::LogStream overloads via one templated helper
instead of duplicating the same stream expression in each, and drop
the manual spaces after the labels since LogStream already inserts a
whitespace between successive stream operations.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

This branch is waiting to be deployed

1 waiting deployment
workflow-approval — 15a7d42e Waiting Sep 15, 2026 by shegazyy via Build and test unit-tests-arm64-qnx / approval #815
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Standardize ProcessInfoNode logs

3 participants