2013-10-11 00:13:55 +00:00
|
|
|
from gevent import monkey
|
|
|
|
monkey.patch_all(dns=False)
|
|
|
|
from .orchestra import monkey
|
|
|
|
monkey.patch_all()
|
2013-10-11 22:10:57 +00:00
|
|
|
|
|
|
|
import logging
|
2014-05-07 16:02:52 +00:00
|
|
|
|
2014-06-12 16:47:28 +00:00
|
|
|
# We don't need to see log entries for each connection opened
|
|
|
|
logging.getLogger('requests.packages.urllib3.connectionpool').setLevel(
|
|
|
|
logging.WARN)
|
|
|
|
|
2014-05-07 16:02:52 +00:00
|
|
|
logging.basicConfig(
|
|
|
|
level=logging.INFO,
|
|
|
|
format='%(asctime)s.%(msecs)03d %(levelname)s:%(name)s:%(message)s')
|
2013-10-11 22:10:57 +00:00
|
|
|
log = logging.getLogger(__name__)
|
2014-05-07 16:02:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
def setup_log_file(logger, log_path):
|
|
|
|
log_formatter = logging.Formatter(
|
|
|
|
fmt=u'%(asctime)s.%(msecs)03d %(levelname)s:%(name)s:%(message)s',
|
|
|
|
datefmt='%Y-%m-%dT%H:%M:%S')
|
|
|
|
log_handler = logging.FileHandler(filename=log_path)
|
|
|
|
log_handler.setFormatter(log_formatter)
|
|
|
|
logger.addHandler(log_handler)
|