clean the debug log, move bloat to DEBUGV
easiest way to enable DEBUGV: set LARIGIRA_DEBUG=1 but production-level debug log really shouldn't be bothered with those messages
This commit is contained in:
parent
9854445f18
commit
32337c54cf
1 changed files with 2 additions and 2 deletions
|
@ -60,6 +60,7 @@ def sd_notify(ready=False, status=None):
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
logging.addLevelName(9, "DEBUGV")
|
||||||
if get_conf()["LOG_CONFIG"]:
|
if get_conf()["LOG_CONFIG"]:
|
||||||
logging.config.fileConfig(
|
logging.config.fileConfig(
|
||||||
get_conf()["LOG_CONFIG"], disable_existing_loggers=True
|
get_conf()["LOG_CONFIG"], disable_existing_loggers=True
|
||||||
|
@ -69,11 +70,10 @@ def main():
|
||||||
"%(asctime)s|%(levelname)s[%(name)s:%(lineno)d] %(message)s"
|
"%(asctime)s|%(levelname)s[%(name)s:%(lineno)d] %(message)s"
|
||||||
)
|
)
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=logging.DEBUG if get_conf()["DEBUG"] else logging.INFO,
|
level="DEBUGV" if get_conf()["DEBUG"] else logging.INFO,
|
||||||
format=log_format,
|
format=log_format,
|
||||||
datefmt="%H:%M:%S",
|
datefmt="%H:%M:%S",
|
||||||
)
|
)
|
||||||
logging.addLevelName(9, "DEBUGV")
|
|
||||||
|
|
||||||
def debugv(self, message, *args, **kws):
|
def debugv(self, message, *args, **kws):
|
||||||
if self.isEnabledFor(9):
|
if self.isEnabledFor(9):
|
||||||
|
|
Loading…
Reference in a new issue