diff options
Diffstat (limited to 'gn3/app.py')
-rw-r--r-- | gn3/app.py | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -3,6 +3,7 @@ import os import sys import logging import getpass +import traceback from typing import Dict from typing import Union @@ -48,9 +49,13 @@ def create_app(config: Union[Dict, str, None] = None) -> Flask: setup_app_handlers(app) # DO NOT log anything before this point - logging.info("Guix Profile: '%s'." % (os.environ.get("GUIX_PROFILE"),)) - logging.info("Python Executable: '%s'." % sys.executable) - logging.info("Effective User: '%s'." % getpass.getuser()) + logging.info("Guix Profile: '%s'.", os.environ.get("GUIX_PROFILE")) + logging.info("Python Executable: '%s'.", sys.executable) + try: + logging.info("Effective User: '%s'.", getpass.getuser()) + except KeyError as kerr: + logging.debug("User Error: %s", kerr.args[0]) + logging.error(traceback.format_exc()) CORS( app, |