Add magnet logger utility#62
Conversation
|
This looks like a good start to me. Though the JHU card I was testing this with was printing stuff out that wasn't getting captured by this logger (and thus not ending up in the saved log file). Also the log output file has quite a bit of extra info on each line that we might not need (e.g. what file and line the log is coming from). I have a slight preference for just a raw log output saved out if possible. I did something like this with the ALIGN system code where the log printed to stdout has all of the formatting etc. but there's also a "raw" log file saved: https://github.com/ITM-Kitware/align-system/blob/main/align_system/cli/run_align_system.py#L48 Would also be curious to hear Jon's thoughts on all of this though. |
|
This is the right direction to go. Something to keep in mind: sequential logging statements are not guaranteed to happen in order if concurrency is happening. This isn't a huge concern here, but I think a hygiene thing we can take care of is instead of printing out logically grouped "blocks" of text line by line, construct the block and then log it out all at once. That way the entire "STATUS" claim is guaranteed to be grouped together. (And it also only has one logger header text, which is the main reason I bring this up) |
Initial attempt at configuring a
magnet-level logger by replacing theprintstatements inevaluation.pywithlogurustatements. The setup function is pulled out fromdownload_helm_results.pywith an additional option for writing out the log (to replace manual copying foraiq-evaluations).For evaluation, the logger is setup at the
evaluatestage to capture the card run directory as its output destination. This logic can happen sooner to collect the card hash and appropriately start the logger sooner. A verbose flag is added tomagnet evaluateto raise the logging level toDEBUG, but this has limited usage currently.