BUG: fix logging for Python < 2.7.

This commit is contained in:
Tony S Yu
2012-04-28 13:34:47 -04:00
parent f4e7e3e437
commit 3ab6300218
+6 -2
View File
@@ -110,7 +110,7 @@ def get_log(name=None):
http://docs.python.org/library/logging.html
"""
import logging, sys
import logging
if name is None:
name = 'skimage'
@@ -128,7 +128,11 @@ def _setup_log():
log = logging.getLogger()
handler = logging.StreamHandler(stream=sys.stdout)
try:
handler = logging.StreamHandler(stream=sys.stdout)
except TypeError:
handler = logging.StreamHandler(strm=sys.stdout)
formatter = logging.Formatter(
'%(name)s: %(levelname)s: %(message)s'
)