VingtCinq / python-mailchimp

Python client for v3 of MailChimp API
MIT License
463 stars 131 forks source link

Logging not working #220

Closed regostar closed 4 years ago

regostar commented 4 years ago
import logging
from mailchimp3 import MailChimp

client = MailChimp(mc_api=<API_KEY>, mc_user=<USER>)
fh = logging.FileHandler('log_files/mailchimp_3_log.log')
logger = logging.getLogger('mailchimp3.client')
logger.addHandler(fh)
client.lists.all(**{'fields': 'lists.date_created'})
{'lists': [{'date_created': '2019-11-22T08:20:54+00:00'}]}

The file log_files/mailchimp_3_log.log is empty!

regostar commented 4 years ago

Resolved by adding this :-

logging.getLogger().setLevel(logging.INFO)