-
Notifications
You must be signed in to change notification settings - Fork 356
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
Make logging better for pycbc_make_offline_workflow #4517
Make logging better for pycbc_make_offline_workflow #4517
Conversation
(The new-style |
e3c38f6
to
da16019
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MInor changes requested, but I think the changes implemented make sense.
# Log to the screen until we know where the output file is | ||
logging.basicConfig(format='%(asctime)s:%(levelname)s : %(message)s', | ||
level=logging.INFO) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this move change anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think it does - looks like the workflow log file is created correctly, and added to the results page as normal
The only difference I see is that we can now configure to use more verbosity by passing the option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh - Ive just seen that there is the second call to the basicConfig to send to the log file
The change to init_logging also makes the default format change to use ISO standard time format including timezone and removes the level
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose the question is which format we want, using the logging level, or the updated timezone format (or neither or both)
I don't want to revert to the direct basicConfig call, as then we would be unable to run with logging.DEBUG and would just lose all of the information we are wanting to make quieter
pycbc/workflow/pegasus_workflow.py
Outdated
@@ -38,6 +39,9 @@ | |||
PEGASUS_FILE_DIRECTORY = os.path.join(os.path.dirname(__file__), | |||
'pegasus_files') | |||
|
|||
# Get the logger associated with the Pegasus workflow import | |||
pegasus_logger = logging.getLogger('Pegasus') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you only access this in one place, it doesn't need to be a global variable, just do this above line 325 (unless I'm missing something??)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved - I had thought it would be needed elsewhere, but its just the once
Co-authored-by: Tito Dal Canton <[email protected]>
pycbc/workflow/pegasus_workflow.py
Outdated
DeprecationWarning("The from_path method in pegasus_workflow is " | ||
"deprecated. Please use File.from_path (for " | ||
"output files) in core.py or resolve_url_to_file " | ||
"in core.py (for input files) instead.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not do anything actually; if you want the warning to be printed, you need something like
import warnings
warnings.warn('Blah', DeprecationWarning)
There is an example of the workflow log file in https://ldas-jobs.ligo.caltech.edu/~gareth.cabourndavies/testoutput/pegasus_verbosity/output/results/9._workflow/H1L1-WORKFLOW-LOG-1368933107-679711.html We should note that is not what is printed to the terminal due to two different loggers, but we see that it removes the super-loud stuff |
@GarethCabournDavies a proposed patch, which I think allows the format to remain, while still updating verbose settings (also minor simplification):
|
* Make logging better for pycbc_make_offline_workflow * comment * Fix bug * CC complaint - there are some other, but these havent been changed by this PR * CC * Update pycbc/workflow/core.py Co-authored-by: Tito Dal Canton <[email protected]> * IH/TDC comments * use warnings module --------- Co-authored-by: Tito Dal Canton <[email protected]>
* Make logging better for pycbc_make_offline_workflow * comment * Fix bug * CC complaint - there are some other, but these havent been changed by this PR * CC * Update pycbc/workflow/core.py Co-authored-by: Tito Dal Canton <[email protected]> * IH/TDC comments * use warnings module --------- Co-authored-by: Tito Dal Canton <[email protected]>
* Make logging better for pycbc_make_offline_workflow * comment * Fix bug * CC complaint - there are some other, but these havent been changed by this PR * CC * Update pycbc/workflow/core.py Co-authored-by: Tito Dal Canton <[email protected]> * IH/TDC comments * use warnings module --------- Co-authored-by: Tito Dal Canton <[email protected]>
* Make logging better for pycbc_make_offline_workflow * comment * Fix bug * CC complaint - there are some other, but these havent been changed by this PR * CC * Update pycbc/workflow/core.py Co-authored-by: Tito Dal Canton <[email protected]> * IH/TDC comments * use warnings module --------- Co-authored-by: Tito Dal Canton <[email protected]>
* Make logging better for pycbc_make_offline_workflow * comment * Fix bug * CC complaint - there are some other, but these havent been changed by this PR * CC * Update pycbc/workflow/core.py Co-authored-by: Tito Dal Canton <[email protected]> * IH/TDC comments * use warnings module --------- Co-authored-by: Tito Dal Canton <[email protected]>
We realised that the pegasus logging was getting a little out of hand in the
pycbc_make_offline_workflow code
. Here I fix this three ways:pycbc_coinc_findtrigs
so was overloading the output as well.After these three changes, the output is much more manageable (I actually noticed config warnings that I hadn't noticed before!).
HOWEVER we might want the info that I have silenced, so I added the call to
pycbc.init_logging
topycbc_make_offline_search_workflow
, so that the verbosity level can be increased if desired. It is at info by default, and will go to debug if--verbose
is given