Open mdemoret-nv opened 4 years ago
For awhile, I've been quite tempted to update this callback so that it uses a Python logger for output rather than just a print statement. That logger would do no formatting whatsoever, leaving spdlog responsible for formatting but also direct messages to the correct Python logging level, which would allow us to play nice with anything that handles or redirects Python logging (e.g. pytest).
The only downside to this is that we would then have three different places at which we could control the logging level: In the spdlog logger, in the Python logger, and in the handler for the Python logger. If we set the spdlog level to error and then the Python logger's level to debug, we would still not see debug messages, which might be counterintuitive. Nevertheless, it would solve the problem raised here.
This issue has been marked rotten due to no recent activity in the past 90d. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.
This issue has been labeled inactive-30d
due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d
if there is no activity in the next 60 days.
Currently, our C++/Python logger is not captured by Pytest and shown as part of the output. This can hide necessary warnings or cause developers to use two different systems for showing warnings. An example output is shown below:
With
cuml.common.logger.warn()
With
warnings.warn()
Part of this issue should be determining what about the warnings causes pytest to capture them, and adding that functionality to
cuml.common.logger
. PyTest references the following link: https://docs.pytest.org/en/stable/warnings.html. Tests should be added to ensure that warning filtering works as well.