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

Improve logging everywhere #15

Open
LeoBaro opened this issue Jan 25, 2025 · 2 comments
Open

Improve logging everywhere #15

LeoBaro opened this issue Jan 25, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@LeoBaro
Copy link
Collaborator

LeoBaro commented Jan 25, 2025

Check all the log messages and their level

@AndreP-git
Copy link
Collaborator

I suggest this as the higher priority feature to improve. If you have some specific ideas to refactor the whole logging system we can discuss asap. We can take some ideas from: Python best practice in terms of logging

@lbabetto
Copy link
Collaborator

In the Data Lake TUI I also follow what they suggest, putting a logger = logging.getLogger(__name__) at the top of each module unit, then adding something like this in the main executable:

logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
fh = logging.FileHandler("dl-tui.log", mode="w")
fh.setLevel(logging.DEBUG)
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
fh.setFormatter(formatter)
logger.addHandler(fh)

Works pretty well in that scenario, makes it clear what is logged by the library and what is logged by external stuff.

@AndreP-git AndreP-git added the enhancement New feature or request label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants