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

Logging level is ignored. #229

Closed
truenicoco opened this issue Nov 1, 2017 · 6 comments
Closed

Logging level is ignored. #229

truenicoco opened this issue Nov 1, 2017 · 6 comments
Assignees
Labels
Projects

Comments

@truenicoco
Copy link

truenicoco commented Nov 1, 2017

When subclassing fbchat.Client, no matter which logging_level is passed, the standard output displays messages at the DEBUG level.

@madsmtm
Copy link
Member

madsmtm commented Nov 10, 2017

fbchat's logging setup is kind of wierd, and I must admit, I don't fully understand it, but maybe you could try to provide some code that should be working, and isn't?

@truenicoco
Copy link
Author

Unfortunately right now I've stopped using fbchat and moved to a XMPP prosody/spectrum/libpurple-facebook solution for my needs.

Here's what my code looked like anyway: https://bitbucket.org/nicocool84/fb_bot/raw/447c246b2b991cf99477a06797365a1252c15414/fb_bot.py

@madsmtm
Copy link
Member

madsmtm commented Nov 10, 2017

I'm sorry was so late at answering, and that I couldn't help you. This is definitely one of the things getting reworked next in the next major release. Good luck with your project anyways ;)

EDIT: I would guess the "solution" would be to include this:

from fbchat import log
log.setLevel(logging_level)

Though this is untested!

@lobstr
Copy link
Contributor

lobstr commented Nov 26, 2017

If you pass it as a numeric value it behaves correctly. See: Logging Levels

@madsmtm
Copy link
Member

madsmtm commented Dec 10, 2017

I will address this further in an upcoming update, seems like the logging system we use is directly in-advised: https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library

@madsmtm madsmtm added the bug label Dec 10, 2017
@madsmtm madsmtm self-assigned this Dec 10, 2017
@madsmtm madsmtm added this to To do in v2.0.0 via automation Jan 3, 2018
madsmtm added a commit that referenced this issue May 3, 2018
@madsmtm madsmtm added this to To do in v2 via automation Jan 9, 2020
@madsmtm
Copy link
Member

madsmtm commented Jan 9, 2020

Fixed a while ago in d3a0ffc, not yet released

@madsmtm madsmtm closed this as completed Jan 9, 2020
v2 automation moved this from To do to Done Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
v2
  
Done
v2.0.0
  
To do
Development

No branches or pull requests

3 participants