diff --git a/web/run.py b/web/run.py index 8edfa4a..92f9046 100755 --- a/web/run.py +++ b/web/run.py @@ -65,22 +65,25 @@ CME_DATE_FMT = "%Y-%m-%dT%H:%MZ" # Are we on the SSA instance for ESA? SSA = environ.get('SSA') == 'true' -DEBUG = environ.get('DEBUG') == 'true' -# SSA = True +DEBUG = environ.get('DEBUG') in ['true', 'True', 1, '1'] # LOGGING ##################################################################### LOG_FILE = get_path('run.log') hp_logger = logging.getLogger("HelioPropa") -if DEBUG: - hp_logger.setLevel(logging.DEBUG) -else: - hp_logger.setLevel(logging.ERROR) +hp_logger.setLevel(logging.DEBUG) + logHandler = logging.FileHandler(LOG_FILE) logHandler.setFormatter(logging.Formatter( "%(asctime)s - %(levelname)s - %(message)s" )) + +# set file messages depending on env var setting +if DEBUG: + logHandler.setLevel(logging.DEBUG) +else: + logHandler.setLevel(logging.ERROR) hp_logger.addHandler(logHandler) # HARDCODED CONFIGURATION ##################################################### -- libgit2 0.21.2