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

Create a custom Logger instance instead of using root one #104

Open
lorenz-gorini opened this issue Dec 10, 2020 · 0 comments
Open

Create a custom Logger instance instead of using root one #104

lorenz-gorini opened this issue Dec 10, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@lorenz-gorini
Copy link
Member

In pytrousse repo, the root Logger instance is used in each module.
This may prevent the pytrousse user to set up a custom logger for pytrousse package, without modifying the root logging instance.

A possible solution could be to create a unique custom logger for pytrousse package that is used by each module, inserting at the beginning of each module the following line:

logger = logging.getLogger(TROUSSE_LOGGER_NAME)

and replacing each root logging instance call with logger one.
For example:

logging.info("My message")

could be replaced by:

logger.info("My message")
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

1 participant