Browse Source

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
boyska 3 years ago
parent
commit
32337c54cf
1 changed files with 2 additions and 2 deletions
  1. 2 2
      larigira/main.py

+ 2 - 2
larigira/main.py

@@ -60,6 +60,7 @@ def sd_notify(ready=False, status=None):
 
 
 def main():
+    logging.addLevelName(9, "DEBUGV")
     if get_conf()["LOG_CONFIG"]:
         logging.config.fileConfig(
             get_conf()["LOG_CONFIG"], disable_existing_loggers=True
@@ -69,11 +70,10 @@ def main():
             "%(asctime)s|%(levelname)s[%(name)s:%(lineno)d] %(message)s"
         )
         logging.basicConfig(
-            level=logging.DEBUG if get_conf()["DEBUG"] else logging.INFO,
+            level="DEBUGV" if get_conf()["DEBUG"] else logging.INFO,
             format=log_format,
             datefmt="%H:%M:%S",
         )
-    logging.addLevelName(9, "DEBUGV")
 
     def debugv(self, message, *args, **kws):
         if self.isEnabledFor(9):