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

Use named loggers #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Use named loggers #92

wants to merge 1 commit into from

Conversation

cunha
Copy link

@cunha cunha commented Jun 16, 2021

The library currently uses the root logger, which prevents
applications from separating their logs from the library's.

With this change, applications can silence or redirect sagan
logs by reconfiguring the "ripe" logger. In particular, the
following will print only FATAL messages from sagan:

def main():
    ripe_logger = logging.getLogger("ripe")
    ripe_logger.setLevel(logging.FATAL)
    ...

close #89

The library currently uses the root logger, which prevents
applications from separating their logs from the library's.

With this change, applications can silence or redirect sagan
logs by reconfiguring the "ripe" logger.  In particular, the
following will print only `FATAL` messages from sagan:

```
def main():
    ripe_logger = logging.getLogger("ripe")
    ripe_logger.setLevel(logging.FATAL)
    ...
```

close RIPE-NCC#89
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use a named logger instead of the root logger
1 participant