import os


def read_setting_from_env(settings, key, default=None):
    env_variable = key.upper()
    if env_variable in os.environ:
        return os.environ[env_variable]
    else:
        return settings.get(key, default)

@@ -1,17 +1,68 @@
 import 
-os
+logging%0Aimport os%0A%0A%0Alog = logging.getLogger(__name__)
 %0A%0A%0Adef r
@@ -190,49 +190,290 @@
     
-return os.environ%5Benv_variable%5D%0A    else:
+log.debug('Setting %25s found in the environment: %25s' %25%0A                  (key, os.environ%5Benv_variable%5D))%0A        return os.environ%5Benv_variable%5D%0A    else:%0A        log.debug('Looking for setting %25s in the selected .ini file: %25s' %25%0A                  (key, settings.get(key, default)))
 %0A   

Add some logging calls to the setting reading