提交 0832b113 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Fixed issue where no logging handler was found in code imported by theano/__init__.py

上级 ddf3109c
...@@ -25,6 +25,13 @@ To learn more, check out: ...@@ -25,6 +25,13 @@ To learn more, check out:
__docformat__ = "restructuredtext en" __docformat__ = "restructuredtext en"
# Set a default logger. It is important to do this before importing some other
# theano code, since this code may want to log some messages.
import logging
logging_default_handler = logging.StreamHandler()
logging.getLogger("theano").addHandler(logging_default_handler)
logging.getLogger("theano").setLevel(logging.WARNING)
import configparser, configdefaults import configparser, configdefaults
config = configparser.TheanoConfigParser() config = configparser.TheanoConfigParser()
...@@ -159,12 +166,3 @@ def dot(l, r): ...@@ -159,12 +166,3 @@ def dot(l, r):
return rval return rval
###
# Set a default logger
#
import logging
logging_default_handler = logging.StreamHandler()
logging.getLogger("theano").addHandler(logging_default_handler)
logging.getLogger("theano").setLevel(logging.WARNING)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论