diff --git a/hikyuu/__init__.py b/hikyuu/__init__.py index 08411681..36f1ccb7 100644 --- a/hikyuu/__init__.py +++ b/hikyuu/__init__.py @@ -48,6 +48,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ +import logging + +logging.basicConfig( + level=logging.INFO, + format='%(asctime)-15s [%(levelname)s] - %(message)s [%(name)s::%(funcName)s]' +) + from .extend import * from .deprecated import * from .indicator import * diff --git a/hikyuu/house.py b/hikyuu/house.py index eb62d3ac..68c1bab0 100644 --- a/hikyuu/house.py +++ b/hikyuu/house.py @@ -566,7 +566,10 @@ def get_part_name_list(house=None, part_type=None): # 初始化仓库 -HouseManager().setup_house() +try: + HouseManager().setup_house() +except Exception as e: + self.logger.warning("无法初始化 hikyuu 策略仓库,请检查网络连接! {}".format(e)) __all__ = [ 'add_remote_house',