I have a flask app.py, inside the app I have a write_to_db.py script. I added logging to a catch-all decorator and now flask does not output any logging to the terminal and my VS Code debugger does not work.
When I look in the error.log file I only see the basic output like:
Running on http://127.0.0.1:7900/ (Press CTRL+C to quit)
import logging logging.basicConfig(filename='eror.log', level=os.environ.get("LOGLEVEL", "CRITICAL")) def catch_all_decorator(f): def wrapper(*args, **kwargs): try: f(*args, **kwargs) return "LOADED" except Exception as e: logging.info(e) logging.exception("STACK TRACE") return "FAIL"
I need to log the stack trace data and still see it in the terminal.