bakwc / PySyncObj

A library for replicating your python class between multiple servers, based on raft protocol
MIT License
706 stars 113 forks source link

Use package logger instead of root logger #179

Closed Agno94 closed 1 year ago

Agno94 commented 1 year ago

The problem we've experienced

We've selected this library to implement Raft in an existing project. We experienced some problem because we have a log parser and this package uses the root logger of the logging module, which cannot/should not be replaced.

For example in dns_resolve.py the function logging.warning is used twice.

We resolved our problem suppressing log from the root logger and forcing propagate=False. But this is not ideal. We miss everything logged by this package.

Solution

This package should create and use its own instance of logging.Logger and used it instead of the root logger.

Usage of the python root logger should be limited to small standalone code only.

zangico commented 1 year ago

Good point, +1

bakwc commented 1 year ago

would be cool if someone prepare PR..

weii41392 commented 1 year ago

Hi, can I work on this?

bakwc commented 1 year ago

Hi, can I work on this?

Sure!