Open FedeMPouzols opened 6 months ago
Maybe I am misunderstanding but warning is there as logger.warning()
... I'll look at the code later but I think everything is there already, it's just how it is accessed is at a different level.
I see what you are asking for I think. I hadn't imagined it being used that way, e.g. having conditional messages based on the logging level. I can add those features if it is important to have. I had thought messages would just be classified as warning (), error(), ect without having a condition.
@jrhosk: not necessarily asking for it. As in the small diff above, it is easy to get around log() not being available, and probably it is better to handle that type of conditional logging level with explicit calls to debug(), warning(), error() etc. as needed.
Something like log() and the logging levels would be more needed I guess if at some point we wanted to define different levels. And I guess that is not really needed for now, just wondering if there was any plans.
Alright, I understand. It can be added, yes. I'll plan on working on it in a few weeks when I get some things off my plate. Thanks for pointing it out.
@FedeMPouzols You can assign this to me if you would like. I'll fix it in the next week or so.
@FedeMPouzols I have added the logger.log()
and logger.exception()
options to the graphviper
logger. They should be in the main branch as soon as JW reviews the changes. The logger keywords are already there since the graphviper logger is just a wrapper on the logging module, a logger instance doesn't give access to those keywords anyway you have to use logging.WARNING
The bugged code just needs to have logger.WARNING changed to logging.WARNING. I have added all the keyword in now though so logger.WARNING
for instance should work. It should work as is now. Let me know if there is an issue after the logger changes are merged.
When loading troublesome colums that produce read errors (such as SPECTRAL_WINDOW/ASSOC_NATURE) a warning/debug message is printed with different level depending on whether the issue happens for a "known troublesome" column or an unexpected column. This got broken after PR #119. Test datasets can produce errors like:
A simple fix could be:
@jrhosk: is there any plan to have these logger.log(), logger.WARNING, logger.INFO, etc. in graphviper.utils.logger, or its interface will stay simpler than Python's logging?