prawn-cake / vk-requests

vk.com requests for humans. API library for vk.com
MIT License
158 stars 22 forks source link

Double logging #25

Closed setazer closed 7 years ago

setazer commented 7 years ago

if I import logging and vk_requests modules at same time and configure new logger import vk_requests, logging ololo = logging.getLogger("Ololo") ololo.setLevel(logging.DEBUG) o_ch = logging.StreamHandler() o_ch.setFormatter(logging.Formatter('%(asctime)s - Test - %(levelname)-8s %(message)s')) ololo.addHandler(o_ch) ololo.info('test')

It actually doubles logs: 2017-07-17 19:22:14,034 - Test - INFO test 2017-07-17 19:22:14,034 INFO [Ololo] test

If I remove vk_requests module from import - logs behave like normal: 2017-07-17 19:22:23,769 - Test - INFO test

Fix it pls

prawn-cake commented 7 years ago

@setazer, thanks for the report. Fixed in v0.9.9 I removed logging.basicConfig(...) call from the library completely to let an end-user decide logging format and other options. Check the README section how to work with logging from now on.