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
from printrun.printrun_utils import install_locale, decode_utf8, setup_logging
install_locale('pronterface')
setup_logging(sys.stdout)
setup_logging(sys.stderr)
def locked(f):
@wraps(f)
......
......@@ -30,10 +30,10 @@ def install_locale(domain):
else:
gettext.install(domain, './locale', unicode = 1)
def setup_logging(stdout):
def setup_logging(out):
logger = logging.getLogger()
logger.handlers.clear()
logging_handler = logging.StreamHandler(stdout)
logging_handler = logging.StreamHandler(out)
logging_handler.setFormatter(logging.Formatter("[%(levelname)s] %(message)s"))
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