If serial.log is disabled, log how to enable it

That will hopefully help a bit against the endless stream of "serial
.log was empty" statements on the bug tracker. Or not. Here's hope.
This commit is contained in:
Gina Häußge committed 2017-10-26 13:13:21 +02:00
1 parent a1548e1c1d
commit 490ef61e19
2 files changed
+4 -1

No files matched your search

+1 -1
View File
@@ -216,7 +216,7 @@ def init_logging(settings, use_logging_file=True, logging_file=None, default_con
},
"loggers": {
"SERIAL": {
"level": "CRITICAL",
"level": "INFO",
"handlers": ["serialFile"],
"propagate": False
},
+3
View File
@@ -208,6 +208,9 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback):
from octoprint.logging.handlers import SerialLogHandler
SerialLogHandler.on_open_connection()
if not logging.getLogger("SERIAL").isEnabledFor(logging.DEBUG):
# if serial.log is not enabled, log a line to explain that to reduce "serial.log is empty" in tickets...
logging.getLogger("SERIAL").info("serial.log is currently not enabled, you can enable it via Settings > Serial Connection > Log communication to serial.log")
self._comm = comm.MachineCom(port, baudrate, callbackObject=self, printerProfileManager=self._printerProfileManager)