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

Add console handler for logging #337

Open
niksirbi opened this issue Oct 31, 2024 · 2 comments
Open

Add console handler for logging #337

niksirbi opened this issue Oct 31, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@niksirbi
Copy link
Member

Our current logging configuration only adds a rotating file handler, and does not configure a console handler. This means:

  • All log messages at the DEBUG level and above are written to the log file.
  • No log messages are output to the console.

What we would actually want:

  • INFO, WARNING, and ERROR messages should be printed both to the log file and the console.
  • DEBUG messages should be written only to the log file.

To achieve this behaviour, we need to add a console handler to our logger and set the appropriate log levels for both handlers.

@niksirbi
Copy link
Member Author

We could also use loguru or fancylog to reduce the amount of logging configuration we have to do on our side.

If we go with fancylog, we'd have to first address this issue.

@sfmig
Copy link
Contributor

sfmig commented Nov 15, 2024

naive question:

is it a matter of adding a

import logging
logging.getLogger().setLevel(logging.INFO)

?

EDIT: we confirm this was indeed naive 😬

I had in my notes that this logging tutorial was useful so linking here in case it helps

@niksirbi niksirbi added bug Something isn't working and removed enhancement New optional feature labels Nov 15, 2024
@niksirbi niksirbi moved this from 🤔 Triage to 📝 Todo in movement progress tracker Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📝 Todo
Development

No branches or pull requests

2 participants