sachin-sankar / swiftshadow

Free IP Proxy rotator library for python
https://sachin-sankar.github.io/swiftshadow/
GNU General Public License v3.0
72 stars 5 forks source link

swiftshadow takes over logging #14

Closed toneman77 closed 1 year ago

toneman77 commented 1 year ago

I do not know how but since I added swiftshadow to my codebase my own logging stopped working. In the file where I import swiftshadow.swiftshadow I do

logging.getLogger().handlers.clear() # <-- first attempt at a workaround
logging.basicConfig(
    filename=script_dir + "/log/mylogfile.log",
    level=debug_level,
    format=(
        "%(asctime)s %(levelname)s " 
        "%(message)s"
    ),
    datefmt="%Y%m%d %H:%M:%S",
)
logger = logging.getLogger("mymainlogger")
logger.info("I am info logging!") # this usually ends up in mylogfile.log

As mentioned this setup worked fine before using swiftshadow. Now my mylogfile.log stays empty and all I see is swiftshadow output on stdout.

Any idea how I can make my logger work again? I tried finding your logger with logging.root.manager.loggerDict by to no avail :(

sachin-sankar commented 1 year ago

I have alos observed this issue. Will release a patch to revert the new logging functionality as there is not a lot to log in the current moment. Print should suffice

toneman77 commented 1 year ago

I have alos observed this issue. Will release a patch to revert the new logging functionality as there is not a lot to log in the current moment. Print should suffice

will it be possible with the patch to still install it via requirements.txt and patch afterwards?

sachin-sankar commented 1 year ago

The patch has been released

pip install -U swiftshadow

To upgrade Or set the version to 0.2.3 in requirements.txt