cassiopeia
cassiopeia copied to clipboard
config for disabling pipelines.py logger
I apologize ahead of time if the answer to this is located somewhere obvious that I've missed, but the datapipelines library has a pipelines module that is insanely verbose in its logging by default. Is there a way to disable this? Further is there a reason it's using .info instead of debug for its default logging level? The info it's logging looks like relevant debug logs but not for info level. Thanks again ahead of time for looking at this.
I'm not a huge fan of the python logging library. Is the issue that you're writing an app that's using it as well?
There should be a way to import the logging library in your first __init__.py
and change the default logging level there. You can change it to something like ERROR
, which will disable the INFO
logging in datapipelines, and then when you create your own loggers you'll have to manually change the logging level per-logger.
I don't remember if there is a reason they are info rather than debug. If you want to submit a PR changing them all the debug, feel free to.
I appreciate that I could hack it to change it, my question was more for my own edification as in: has no one else complained/mentioned this as a problem/annoyance from a user experience perspective? It seems like this would have come up for anyone using this library but I could be way off the mark here. Sorry if this is coming off combative (it's not meant to), I know this is an OSS project and do not mean to criticize.
You are in fact the first one to complain about it since we released it 3 years ago :) We probably should change the logging functionality to give the user more control, but given the feedback it's honestly at the very bottom of the priority list. We've always got a million projects on the backlog, and a couple of my higher-up items include providing accurate role/lane info for all matches, and providing a hook into the LCU so that websites can get information from things like champion select in real-time. Those are much higher impact, so frankly they take precedence over something like this (and this logging improvement is also something our users would be able to reasonably contribute).
Here are a couple stack overflow posts that should help you get around the issue: https://stackoverflow.com/questions/53249304/how-to-get-the-list-all-existing-loggers-using-python-logging-module and https://stackoverflow.com/questions/35325042/python-logging-disable-logging-from-imported-modules
The best thing to do here would be to encapsulate the logging of the datapipelines library and expose a configuration option in Cass or datapipelines to configure how the user wants logging for the library to be handled. If you're interested in doing this, please talk to us about it in more depth and it's very likely that we'll be happy to accept a PR.
Thanks for the info, I'd be happy to submit a PR for this. It may take me a day or two.