Skip to content
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

config for disabling pipelines.py logger #298

Open
ereesman opened this issue Oct 9, 2019 · 4 comments
Open

config for disabling pipelines.py logger #298

ereesman opened this issue Oct 9, 2019 · 4 comments

Comments

@ereesman
Copy link

ereesman commented Oct 9, 2019

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.

@jjmaldonis
Copy link
Member

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.

@ereesman
Copy link
Author

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.

@jjmaldonis
Copy link
Member

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.

@ereesman
Copy link
Author

Thanks for the info, I'd be happy to submit a PR for this. It may take me a day or two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants