From 178b2f36d71a7ec7e69d580e798bb3bfefbb0fbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Sun, 17 Mar 2013 22:32:35 +0100 Subject: [PATCH] Only log the terminal output to disk if the "--debug" commandline switch is given Otherwise slowdowns might be caused on Raspberry Pi when dumping all printer communication to SD --- octoprint/server.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/octoprint/server.py b/octoprint/server.py index 8ae920a..63c096c 100644 --- a/octoprint/server.py +++ b/octoprint/server.py @@ -519,17 +519,20 @@ class Server(): } }, "loggers": { - "SERIAL": { - "level": "DEBUG", - "handlers": ["serialFile"], - "propagate": False - } }, "root": { "level": "INFO", "handlers": ["console", "file"] } } + + if debug: + self._config["loggers"]["SERIAL"] = { + "level": "DEBUG", + "handlers": ["serialFile"], + "propagate": False + } + logging.config.dictConfig(self._config) if __name__ == "__main__":