Эх сурвалжийг харах

HUE-9108 [core] Revert prettify unifying the general log level

This change in
https://github.com/cloudera/hue/commit/aac6fcbeb7a49682f48ffd9829a05cf0b18e4d93
The logic does not work, because it compares a logger with a handler
which does not have the same id.
Jean-Francois Desjeans Gauthier 6 жил өмнө
parent
commit
29ee0b05ed

+ 4 - 4
desktop/core/src/desktop/log/__init__.py

@@ -189,10 +189,10 @@ def basic_logging(proc_name, log_dir=None):
     handler.setLevel(lvl)
 
     # Set all loggers but error.log to the same logging level
-    error_handler = logging.getLogger('handler_errorlog')
-    for h in root_logger.handlers:
-      if isinstance(h, (FileHandler, RotatingFileHandler)) and h != error_handler:
-        h.setLevel(lvl)
+    for h in root_logger.__dict__['handlers']:
+      if isinstance(h, (FileHandler, RotatingFileHandler)):
+        if os.path.basename(h.baseFilename) != 'error.log':
+          h.setLevel(lvl)
 
 
 def fancy_logging():