Commit c6c0dbe5 authored by Guillaume Seguin's avatar Guillaume Seguin

Log to stderr in printcore & pronsole

parent 25adff51
...@@ -38,7 +38,7 @@ from printrun.GCodeAnalyzer import GCodeAnalyzer ...@@ -38,7 +38,7 @@ from printrun.GCodeAnalyzer import GCodeAnalyzer
from printrun.printrun_utils import install_locale, decode_utf8, setup_logging from printrun.printrun_utils import install_locale, decode_utf8, setup_logging
install_locale('pronterface') install_locale('pronterface')
setup_logging(sys.stdout) setup_logging(sys.stderr)
def locked(f): def locked(f):
@wraps(f) @wraps(f)
......
...@@ -30,10 +30,10 @@ def install_locale(domain): ...@@ -30,10 +30,10 @@ def install_locale(domain):
else: else:
gettext.install(domain, './locale', unicode = 1) gettext.install(domain, './locale', unicode = 1)
def setup_logging(stdout): def setup_logging(out):
logger = logging.getLogger() logger = logging.getLogger()
logger.handlers.clear() logger.handlers.clear()
logging_handler = logging.StreamHandler(stdout) logging_handler = logging.StreamHandler(out)
logging_handler.setFormatter(logging.Formatter("[%(levelname)s] %(message)s")) logging_handler.setFormatter(logging.Formatter("[%(levelname)s] %(message)s"))
logger.addHandler(logging_handler) logger.addHandler(logging_handler)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment