[meld] Set up file logging on Windows
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Set up file logging on Windows
- Date: Mon, 30 Dec 2019 22:46:11 +0000 (UTC)
commit 28102e3c14f5234b5df7e1205e18e518adcb2832
Author: Kai Willadsen <kai willadsen gmail com>
Date: Tue Dec 31 08:36:26 2019 +1000
Set up file logging on Windows
In our Windows environment we don't generally get *any* logging for
error cases, which makes crashes, etc. impossible to diagnose. This
change makes it so that we at least have a log file available that
*might* catch a traceback or something that we can use.
bin/meld | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/bin/meld b/bin/meld
index ac72f0f2..2e60a46d 100755
--- a/bin/meld
+++ b/bin/meld
@@ -330,7 +330,15 @@ def setup_logging():
else:
log.setLevel(logging.CRITICAL)
- handler = logging.StreamHandler()
+ if sys.platform == 'win32':
+ from gi.repository import GLib
+
+ log_path = os.path.join(GLib.get_user_data_dir(), "meld.log")
+ handler = logging.FileHandler(log_path)
+ log.setLevel(logging.INFO)
+ else:
+ handler = logging.StreamHandler()
+
formatter = logging.Formatter("%(asctime)s %(levelname)s "
"%(name)s: %(message)s")
handler.setFormatter(formatter)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]