From eed7c3597d61001d7c5f253fcccc43e0a86a229e Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Fri, 2 Nov 2018 18:11:49 +0100 Subject: [PATCH] added new function: debug_log() --- lib/globals.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/globals.py b/lib/globals.py index ccbdd9b..b10638b 100644 --- a/lib/globals.py +++ b/lib/globals.py @@ -87,6 +87,14 @@ def log(text): print text logging.info(text) +def debug_log(text): + """ + Write `text` to the debug log + """ + + with open('/tmp/wttr.in-debug.log', 'a') as f_debug: + f_debug.write(text+'\n') + def get_help_file(lang): "Return help file for `lang`"