Răsfoiți Sursa

the default notify level needs to be info.

David Rose 19 ani în urmă
părinte
comite
95985c7c1b
1 a modificat fișierele cu 23 adăugiri și 26 ștergeri
  1. 23 26
      direct/src/directnotify/DirectNotify.py

+ 23 - 26
direct/src/directnotify/DirectNotify.py

@@ -76,37 +76,34 @@ class DirectNotify:
 
         if not level:
             # see if there's an override of the default config level
-            level = config.GetString('default-directnotify-level', '')
+            level = config.GetString('default-directnotify-level', 'info')
+        if not level:
+            level = 'error'
 
         category = self.getCategory(categoryName)
-        if level:
-            # Note - this print statement is making it difficult to
-            # achieve "no output unless there's an error" operation - Josh
-            # print ("Setting DirectNotify category: " + categoryName +
-            #        " to severity: " + level)
-            if level == "error":
-                category.setWarning(0)
-                category.setInfo(0)
-                category.setDebug(0)
-            elif level == "warning":
-                category.setWarning(1)
-                category.setInfo(0)
-                category.setDebug(0)
-            elif level == "info":
-                category.setWarning(1)
-                category.setInfo(1)
-                category.setDebug(0)
-            elif level == "debug":
-                category.setWarning(1)
-                category.setInfo(1)
-                category.setDebug(1)
-            else:
-                print ("DirectNotify: unknown notify level: " + str(level)
-                       + " for category: " + str(categoryName))
-        else:
+        # Note - this print statement is making it difficult to
+        # achieve "no output unless there's an error" operation - Josh
+        # print ("Setting DirectNotify category: " + categoryName +
+        #        " to severity: " + level)
+        if level == "error":
             category.setWarning(0)
             category.setInfo(0)
             category.setDebug(0)
+        elif level == "warning":
+            category.setWarning(1)
+            category.setInfo(0)
+            category.setDebug(0)
+        elif level == "info":
+            category.setWarning(1)
+            category.setInfo(1)
+            category.setDebug(0)
+        elif level == "debug":
+            category.setWarning(1)
+            category.setInfo(1)
+            category.setDebug(1)
+        else:
+            print ("DirectNotify: unknown notify level: " + str(level)
+                   + " for category: " + str(categoryName))
             
 
     def setDconfigLevels(self):