More kivy'ish way of silencing logging
authorNeil <neil@dip.sun.ac.za>
Sat, 20 Apr 2013 17:45:09 +0000 (19:45 +0200)
committerNeil <neil@dip.sun.ac.za>
Sat, 20 Apr 2013 17:45:09 +0000 (19:45 +0200)
erdslangetjie/constants.py

index c9f16e6b4c2a949efbc28fcd1274b48c8ee54f14..35c2e888e6ef4112f08661e9de9e0dd0ded328af 100644 (file)
@@ -3,16 +3,15 @@ import kivy
 kivy.require('1.6.0')
 
 from kivy.logger import Logger, LoggerHistory
+from kivy.config import Config
 
 QUIET = False  # kivy logging - change for release
 
 if QUIET:
-    for hdlr in Logger.handlers[:]:
-        if not isinstance(hdlr, LoggerHistory):
-            Logger.removeHandler(hdlr)
+    Config.set('kivy', 'log_enable', 0)
+    Config.set('kivy', 'log_level', 'critical')
 
 from kivy.utils import platform
-from kivy.config import Config
 
 if platform() != 'android':
     TILE_SIZE = 38