Commit 0a5dca82 authored by Guillaume Seguin's avatar Guillaume Seguin

WIP #561: restore stdstreams in printcore, don't butcher loggers

And move setup_logging to the main printcore app file. This way we don't
need to butcher loggers anymore
parent 0301ad79
......@@ -20,9 +20,11 @@ import getopt
import sys
from printrun.printcore import printcore
from printrun.utils import setup_logging
from printrun import gcoder
if __name__ == '__main__':
setup_logging(sys.stderr)
baud = 115200
loud = False
statusreport = False
......
......@@ -25,7 +25,9 @@ import time
import platform
import os
import sys
stdin, stdout, stderr = sys.stdin, sys.stdout, sys.stderr
reload(sys).setdefaultencoding('utf8')
sys.stdin, sys.stdout, sys.stderr = stdin, stdout, stderr
import logging
import traceback
import errno
......@@ -34,11 +36,9 @@ import re
from functools import wraps
from collections import deque
from printrun import gcoder
from .utils import install_locale, decode_utf8, setup_logging
from .utils import install_locale, decode_utf8
install_locale('pronterface')
setup_logging(sys.stderr)
def locked(f):
@wraps(f)
def inner(*args, **kw):
......
......@@ -51,7 +51,6 @@ def setup_logging(out, filepath = None):
logger = logging.getLogger()
logger.setLevel(logging.INFO)
formatter = LogFormatter("[%(levelname)s] %(message)s", "%(message)s")
logger.handlers = []
logging_handler = logging.StreamHandler(out)
logging_handler.setFormatter(formatter)
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