Skip to content

Use dedicated loggers for ClientSession/Place - #1950

Open
Bastian-Krause wants to merge 3 commits into
labgrid-project:masterfrom
Bastian-Krause:bst/no-root-logger
Open

Use dedicated loggers for ClientSession/Place#1950
Bastian-Krause wants to merge 3 commits into
labgrid-project:masterfrom
Bastian-Krause:bst/no-root-logger

Conversation

@Bastian-Krause

Copy link
Copy Markdown
Member

Description
labgrid produces a lot of logs. Try to get rid of logs emitted by the root logger, so proper filtering and attribution is possible.

Checklist

  • PR has been tested

Allows attributing the messages logged to the corresponding labgrid
component.

Signed-off-by: Bastian Krause <bst@pengutronix.de>
Helps attributing log messages to ClientSession. Otherwise they are
logged using the root logger.

Signed-off-by: Bastian Krause <bst@pengutronix.de>
Helps attributing log messages to Place. Otherwise they are logged using
the root logger.

Signed-off-by: Bastian Krause <bst@pengutronix.de>
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.86957% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.0%. Comparing base (029850b) to head (cd26faa).
⚠️ Report is 3 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
labgrid/remote/client.py 53.3% 7 Missing ⚠️
labgrid/remote/common.py 75.0% 2 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master   #1950   +/-   ##
======================================
  Coverage    61.0%   61.0%           
======================================
  Files         182     182           
  Lines       14898   14903    +5     
======================================
+ Hits         9097    9103    +6     
+ Misses       5801    5800    -1     
Flag Coverage Δ
3.10 61.0% <60.8%> (+<0.1%) ⬆️
3.11 61.0% <60.8%> (+<0.1%) ⬆️
3.12 61.0% <60.8%> (-0.1%) ⬇️
3.13 61.0% <60.8%> (+<0.1%) ⬆️
3.14 61.0% <60.8%> (-0.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Comment thread labgrid/remote/client.py
self.sync_id = itertools.count(start=1)
self.sync_events = {}

self.logger = logging.getLogger("ClientSession")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a session identifier into the longer? f"ClientSession.{address}"?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't think of a case with multiple ClientSessions in a single run, so I guess it's not required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants