Refactor: Enhance Flask Application Logging for Clarity and Conciseness
authorSam Mirazi <sasan345@gmail.com>
Tue, 3 Jun 2025 19:13:54 +0000 (12:13 -0700)
committerSam Mirazi <sasan345@gmail.com>
Tue, 3 Jun 2025 19:13:54 +0000 (12:13 -0700)
commit660ca90232886ab05aa5db3b9fdaa8e1a5e087ee
treec35fbfb36e8a13bd1045e443d4cc754e141e5157
parentba8b3faa81064717ecb19b971ffba6c3720dd18f
Refactor: Enhance Flask Application Logging for Clarity and Conciseness

This commit refines the logging output of the Flask application (`app_flask/Flask_with_delay.py`) to improve readability and provide clearer status indicators during benchmark runs.

Two key changes were implemented:

1.  **Disable Werkzeug's Default Access Logs:**
    The standard Werkzeug request logger (which produces lines like `127.0.0.1 - - [timestamp] "GET / HTTP/1.1" 200 -`) has been disabled. This is achieved by getting the 'werkzeug' logger instance and setting its logging level to `ERROR`. This change significantly reduces log verbosity, allowing the custom application logs to be more prominent and easier to follow.

2.  **Add Explicit "OK" Confirmation to Custom Logs:**
    The custom log message printed by the Flask server upon successful request processing has been augmented with an " - OK" suffix. The log line now appears as `[Flask Server] Request {id} processed in {time}s - OK`. This provides an unambiguous visual confirmation that each request was handled successfully by the server, which is particularly useful when monitoring benchmark progress.

These modifications aim to make the Flask server's console output more focused and informative, aiding in the analysis of benchmark results by removing redundant log entries and clearly indicating successful operations.
app_flask/Flask_with_delay.py