From a5d54c2cb61c59514129193a2f79e88333238f62 Mon Sep 17 00:00:00 2001 From: Joakim Persson Date: Tue, 23 Jul 2024 14:22:30 +0200 Subject: [PATCH] =?UTF-8?q?Tog=20bort=20import=20fr=C3=A5n=20backend.py=20?= =?UTF-8?q?f=C3=B6r=20att=20undvika=20cirkul=C3=A4r=20import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- smartassist/src/utils.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/smartassist/src/utils.py b/smartassist/src/utils.py index b0eff29..23ec68b 100644 --- a/smartassist/src/utils.py +++ b/smartassist/src/utils.py @@ -2,11 +2,9 @@ # imported to more than one other module. The rational for defining these things here # is that it is easier to avoid circular imports when they are defined in a central location. import logging +global log_level # Remember, in Python globals are only global in the module it is defined in +log_level = 'INFO' # Default logging level -global log_level -log_level = 'INFO' - -logger = logging.getLogger(__name__) def set_local_logger(log_instance): """ @@ -22,14 +20,3 @@ def set_local_logger(log_instance): logging.basicConfig(level=numeric_log_level) # Set the root logger level to the configured level log_instance.info('Log level set to {}'.format(log_level)) # Example usage of the logger - -def run_flask(app, fport=5005): - """ - Starts the Flask server - """ - # Flask endpoint for user interaction - logger.debug("Entering run_flask()") - # app.run(port = str(str(fport)), debug=False) - app.run(port = str(str(fport)), debug=True) - # app.run(port=5000, debug=True, use_reloader=False) - logger.debug("Exiting run_flask()") \ No newline at end of file