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
master
Gina Häußge 2013-03-17 22:32:35 +01:00
parent 1477fb31fb
commit 178b2f36d7
1 changed files with 8 additions and 5 deletions

View File

@ -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__":