path hacking for logging.cfg

This commit is contained in:
fawce
2012-05-21 16:21:29 -04:00
parent b47a3d8241
commit 46ef2e136d
3 changed files with 13 additions and 2 deletions
View File
+6 -1
View File
@@ -1,7 +1,7 @@
"""
Factory functions to prepare useful data for tests.
"""
import os
import pytz
import msgpack
import random
@@ -21,6 +21,11 @@ def data_path():
data_path = dirname(abspath(data.__file__))
return data_path
def logger_path():
import zipline
log_path = dirname(abspath(zipline.__file__))
return os.join(log_path, 'logging.cfg')
def load_market_data():
fp_bm = open(join(data_path(), "benchmark.msgpack"), "rb")
bm_list = msgpack.loads(fp_bm.read())
+7 -1
View File
@@ -5,9 +5,15 @@ and other common operations.
import logging
import logging.config
from os.path import join, abspath, dirname
def configure_logging():
logging.config.fileConfig(
'logging.cfg',
logger_path(),
disable_existing_loggers = False
)
def logger_path():
import zipline
log_path = dirname(abspath(zipline.__file__))
return join(log_path, 'logging.cfg')