From ad75b57b2a73b3bc2dee22a9e3fe4e00b1e41ac1 Mon Sep 17 00:00:00 2001 From: Ali Riza KESKIN Date: Tue, 9 Jul 2024 09:36:28 +0000 Subject: [PATCH] logging improvements --- src/module/daemon.py | 1 + src/util.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/module/daemon.py b/src/module/daemon.py index f4fdb43..3a07833 100644 --- a/src/module/daemon.py +++ b/src/module/daemon.py @@ -11,6 +11,7 @@ def module_init(): debug("Creating fifo") os.mkfifo("/{}/pardus-greeter".format(busdir)) try: + debug("Listening fifo") with open("/{}/pardus-greeter".format(busdir),"r") as f: username="" password="" diff --git a/src/util.py b/src/util.py index 41e09e8..a3ec13a 100644 --- a/src/util.py +++ b/src/util.py @@ -68,9 +68,11 @@ def get(variable, default=None, section="pardus"): return False return str(ret) +ltime=time.time() if get("debug", False, "pardus"): def debug(msg): - log("[DEBUG] => {}\n".format(msg), type="debug") + log("[DEBUG:{}] => {}\n".format((int(1000*(time.time()-ltime))), msg), type="debug") + ltime=time.time() else: def debug(msg): return