From 3676adc69feea57a6c12873e4b8aa2ac5a37664a Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Tue, 30 Jan 2024 16:28:12 +0000 Subject: [PATCH] add more logging --- pvnet_app/app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pvnet_app/app.py b/pvnet_app/app.py index 7f55474..12421f7 100644 --- a/pvnet_app/app.py +++ b/pvnet_app/app.py @@ -85,8 +85,12 @@ stream_handler = logging.StreamHandler() stream_handler.setFormatter(formatter) +logging.basicConfig( + level=getattr(logging, os.getenv("LOGLEVEL", "INFO")), + format="[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s", +) + logger = logging.getLogger(__name__) -logger.setLevel(getattr(logging, os.getenv("LOGLEVEL", "INFO"))) logger.addHandler(stream_handler) # Get rid of these verbose logs