From e37e5f1bfa03ad51aa7ed82667b90a43c4b32404 Mon Sep 17 00:00:00 2001 From: fernanqv Date: Thu, 23 Jun 2022 07:48:55 +0200 Subject: [PATCH] wrf4g status logging fixed --- wrf4g/commands/status.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wrf4g/commands/status.py b/wrf4g/commands/status.py index e89d038a..1cf1b773 100644 --- a/wrf4g/commands/status.py +++ b/wrf4g/commands/status.py @@ -34,6 +34,10 @@ def run( arg ) : try: + # El logger no funcionaba porque el import logging se hace varias veces y coge la primera. Hacemos un reload para que funcione + # https://stackoverflow.com/questions/20240464/python-logging-file-is-not-working-when-using-logging-basicconfig + from imp import reload + reload(logging) logging.basicConfig( format = '%(message)s', level = logging.DEBUG if arg[ '--dbg' ] else logging.INFO, stream = sys.stdout )