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

CLI arguments for 'start-re-manager' to set logging verbosity #135

Merged
merged 11 commits into from
Mar 16, 2021

Conversation

dmgav
Copy link
Contributor

@dmgav dmgav commented Mar 10, 2021

The set of CLI parameters was added to start-re-manager that allow to modify verbosity of logging output. Currently logging can only be sent to stdout/stderr. By default, RE Manager will display log messages starting from loglevel=INFO. The log includes warnings, errors, brief messages with information about the state of the manager and worker processes and executed steps. This behavior may be modified by calling start-re-manager with the following mutually exclusive parameters:

  • --verbose prints all logging messages including DEBUG messages. In addition to short messages indicating the executed steps, the output will display contents of all received/send messages, submitted plans etc. Verbose output may be useful for debugging purposes, but may slow down the system if the plan queue, history or the lists of plans/devices become long.

  • --quiet prints only warning and error message. Output is insufficient to monitor plan execution.

  • --silent disables logging.

Resolves the issue #130

@dmgav dmgav changed the title Log verbosity CLI arguments for 'start-re-manager' to set logging verbosity Mar 10, 2021
Copy link
Member

@mrakitin mrakitin left a comment

Choose a reason for hiding this comment

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

I am only concerned about logging.basicConfig(level=max(logging.WARNING, self._log_level)) (left a comment), otherwise looks good.

@@ -1521,8 +1522,7 @@ def run(self):
Overrides the `run()` function of the `multiprocessing.Process` class. Called
by the `start` method.
"""

logging.basicConfig(level=logging.WARNING)
logging.basicConfig(level=max(logging.WARNING, self._log_level))
Copy link
Member

Choose a reason for hiding this comment

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

What is the intention here? E.g. if self._log_level is INFO (=20), the set level will be WARNING (=30). The description says the default is INFO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would be logging level for other packages except bluesky_queueserver for which logging is not set explicitly. Typically it is undesirable to get debug/info logging from all packages in any circumstances. So here I limit logging level to WARNING or higher.

bluesky_queueserver/manager/plan_monitoring.py Outdated Show resolved Hide resolved
bluesky_queueserver/manager/start_manager.py Outdated Show resolved Hide resolved
Co-authored-by: Maksim Rakitin <mrakitin@users.noreply.github.com>
Copy link
Member

@mrakitin mrakitin left a comment

Choose a reason for hiding this comment

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

Looks good to me now. Thanks for accepting the suggestions, @dmgav!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants