Configurable enable/disable additional logging
authorSofia Papagiannaki <papagian@gmail.com>
Thu, 31 May 2012 11:52:21 +0000 (14:52 +0300)
committerSofia Papagiannaki <papagian@gmail.com>
Thu, 31 May 2012 11:52:21 +0000 (14:52 +0300)
Refs: #2448

snf-astakos-app/astakos/im/functions.py
snf-astakos-app/astakos/im/settings.py

index f8bbfe0..172e712 100644 (file)
@@ -67,7 +67,8 @@ def logged(func, msg):
             user = request.user
         email = user.email if user and user.is_authenticated() else ''
         r = func(*args, **kwargs)
-        logger._log(LOGGING_LEVEL, msg % email, [])
+        if LOGGING_LEVEL:
+            logger._log(LOGGING_LEVEL, msg % email, [])
         return r
     return with_logging
 
index 7744e8d..863130c 100644 (file)
@@ -83,6 +83,6 @@ EMAILCHANGE_ENABLED = getattr(settings, 'ASTAKOS_EMAILCHANGE_ENABLED', False)
 # Set the expiration time (in days) of email change requests
 EMAILCHANGE_ACTIVATION_DAYS = getattr(settings, 'ASTAKOS_EMAILCHANGE_ACTIVATION_DAYS', 10)
 
-# Set the astakos message logging severity
+# Set the astakos main functions logging severity (None to disable)
 from logging import INFO
 LOGGING_LEVEL = getattr(settings, 'ASTAKOS_LOGGING_LEVEL', INFO)
\ No newline at end of file