Skip to content

Move ubwa logging to new loggers #164

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

Closed
xilopaint opened this issue Apr 17, 2021 · 2 comments
Closed

Move ubwa logging to new loggers #164

xilopaint opened this issue Apr 17, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@xilopaint
Copy link

xilopaint commented Apr 17, 2021

Is your feature request related to a problem? Please describe.
In Python the logging structure is inherited from the root logger. I think the choice of using the root logger for the logging events of a library is not a good practice and makes difficult for developers building their own logging structure.

Describe the solution you'd like
Avoid using the root logger and create new loggers for ubwa modules. Here's some guidelines from Python docs:

A good convention to use when naming loggers is to use a module-level logger, in each module which uses logging, named as follows:

logger = logging.getLogger(__name__)
This means that logger names track the package/module hierarchy, and it’s intuitively obvious where events are logged just from the logger name.

The root of the hierarchy of loggers is called the root logger. That’s the logger used by the functions debug(), info(), warning(), error() and critical(), which just call the same-named method of the root logger. The functions and the methods have the same signatures. The root logger’s name is printed as ‘root’ in the logged output.

@xilopaint xilopaint added the enhancement New feature or request label Apr 17, 2021
@oliver-zehentleitner
Copy link
Member

I would merge a PR

@kylematoba kylematoba mentioned this issue Dec 5, 2021
10 tasks
@oliver-zehentleitner
Copy link
Member

Thanks to @kylematoba for the PR! It will be included in the next release!

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

2 participants