Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/registry logging #414

Merged
merged 12 commits into from
Aug 28, 2024
Merged

Fix/registry logging #414

merged 12 commits into from
Aug 28, 2024

Conversation

andre-merzky
Copy link
Member

This makes ZMQ logging more sane to handle.

Copy link

codecov bot commented Aug 23, 2024

Codecov Report

Attention: Patch coverage is 79.51807% with 17 lines in your changes missing coverage. Please review.

Project coverage is 62.18%. Comparing base (140d527) to head (b7f3e14).
Report is 13 commits behind head on devel.

Files with missing lines Patch % Lines
src/radical/utils/zmq/queue.py 80.76% 5 Missing ⚠️
src/radical/utils/zmq/registry.py 76.47% 4 Missing ⚠️
src/radical/utils/zmq/utils.py 33.33% 4 Missing ⚠️
src/radical/utils/zmq/pubsub.py 89.47% 2 Missing ⚠️
.../plugins/unittests_1/plugin_unittests_default_1.py 0.00% 1 Missing ⚠️
.../plugins/unittests_2/plugin_unittests_default_1.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            devel     #414      +/-   ##
==========================================
+ Coverage   61.95%   62.18%   +0.22%     
==========================================
  Files          62       62              
  Lines        6845     6899      +54     
==========================================
+ Hits         4241     4290      +49     
- Misses       2604     2609       +5     

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

src/radical/utils/zmq/registry.py Outdated Show resolved Hide resolved
src/radical/utils/zmq/registry.py Outdated Show resolved Hide resolved
src/radical/utils/zmq/registry.py Outdated Show resolved Hide resolved
src/radical/utils/zmq/registry.py Outdated Show resolved Hide resolved
Comment on lines +11 to +12
# NOTE: this is ignoring `RADICAL_LOG_LVL` on purpose
LOG_ENABLED = os.environ.get('RADICAL_ZMQ_LOG', '0').lower() in ['1', 'true']
Copy link
Collaborator

Choose a reason for hiding this comment

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

I got confused with the necessity of introducing this.. I see that you've updated ns for loggers (some of them were already set correctly), which makes it easy and right way to control all of this with RADICAL_UTILS_ZMQ_LOG_LVL.
As well:

  • all debug messages here are level 9, thus they will never appear for the regular debugging and controlling their appearance with the env variable above is straightforward;
  • with the proposed setup it is not possible to turn off zmq-related log messages completely;

Copy link
Collaborator

Choose a reason for hiding this comment

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

one more thing, we can keep an explicit default value for RADICAL_UTILS_ZMQ_LOG_LVL in DefaultConfig (utils_default.json)

Copy link
Member Author

Choose a reason for hiding this comment

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

Not really a necessity, but convenience: the ns is not consistently used, specifically when some ZMQ subscriber etc uses a 3rd party logger (such as the agent logger etc). Also, the bulk_log method is a bit expensive even when not logging anything, so I wanted to shield zmq logging separately.

Copy link
Collaborator

@mtitov mtitov left a comment

Choose a reason for hiding this comment

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

LGTM!

@andre-merzky andre-merzky merged commit 42fd44e into devel Aug 28, 2024
9 checks passed
@andre-merzky andre-merzky deleted the fix/registry_logging branch August 28, 2024 20:50
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