mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-28 13:17:43 +08:00
path hacking for logging.cfg
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user