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

Logging improvements #88

Closed
LourensVeen opened this issue Dec 21, 2020 · 5 comments · Fixed by #91
Closed

Logging improvements #88

LourensVeen opened this issue Dec 21, 2020 · 5 comments · Fixed by #91

Comments

@LourensVeen
Copy link

I'm using QCG-PilotJob as a library, and when I do so my program spews a lot of log messages from QCG-PJ on the console. I'd like to redirect them to a separate log file. Unfortunately:

  • All log messages are sent to the root logger, rather than to a module specific logger,
  • There are print statements in the code, which cannot be controlled from the logging subsystem, and
  • QCG-PJ sets the root logger's log level, overriding my own settings.

I'd like to:

  • modify the log statements to follow the scheme from Python's Advanced Logging Tutorial, so that the log output can be configured cleanly,
  • replace the print statements by log statements (at INFO-level?),
  • have QCG-PJ only set the root logger's log level when run in command line mode, but not when used as a library.

I'm going to try to have a new version of MUSCLE3 out with the next VECMAtk release in January, and I realise this is soon, so I'm offering to submit a pull request with the above changes, if you agree that it's a good idea?

@LourensVeen LourensVeen changed the title QCG-PilotJob logging improvements Logging improvements Dec 21, 2020
@pkopta
Copy link

pkopta commented Dec 21, 2020

Yes, you are right - the logging in the QCG-PilotJob is a bit messy. If you have a ready pull request I will be glad if you will push it to the repo.

@LourensVeen
Copy link
Author

I've made a PR for this. It's slightly different than what I wrote above, logging is now done using module-specific loggers, and where QCGPJ used the root logger it now uses the qcg.pilotjob logger instead (including for determining whether we're in debug mode). In my test program I now no longer get messages on the console.

@LourensVeen
Copy link
Author

Thanks for merging! Do you normally close issues when they've been implemented, or when the fix has been released?

@pkopta
Copy link

pkopta commented Jan 5, 2021

I always thought that issue should be automatically closed after merging pull request (thanks to 'close #' in comment) but apparently this is not true.

@LourensVeen
Copy link
Author

Interesting! I had a quick look at the documentation, and it seems that this only works if the PR is merged into the default branch. For this repo, that's master, while this PR was merged into develop. So that would explain.

I normally have my default branch set to develop, but that also has disadvantages, like people seeing the README for the latest in-development version rather than for the latest release. I guess we'll have to use the close button then :-).

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 a pull request may close this issue.

2 participants