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 SDmaster
parent
1477fb31fb
commit
178b2f36d7
|
@ -519,17 +519,20 @@ class Server():
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"loggers": {
|
"loggers": {
|
||||||
"SERIAL": {
|
|
||||||
"level": "DEBUG",
|
|
||||||
"handlers": ["serialFile"],
|
|
||||||
"propagate": False
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"level": "INFO",
|
"level": "INFO",
|
||||||
"handlers": ["console", "file"]
|
"handlers": ["console", "file"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if debug:
|
||||||
|
self._config["loggers"]["SERIAL"] = {
|
||||||
|
"level": "DEBUG",
|
||||||
|
"handlers": ["serialFile"],
|
||||||
|
"propagate": False
|
||||||
|
}
|
||||||
|
|
||||||
logging.config.dictConfig(self._config)
|
logging.config.dictConfig(self._config)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in New Issue