From 0ab9d1baed2484143e8a0c3f585ce48541890f50 Mon Sep 17 00:00:00 2001 From: jaydee Date: Mon, 5 May 2025 18:21:22 +0200 Subject: [PATCH] klal --- mqtt_srv.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mqtt_srv.py b/mqtt_srv.py index ad45721..0d6303c 100755 --- a/mqtt_srv.py +++ b/mqtt_srv.py @@ -32,6 +32,11 @@ VERSION = "1.0.37" curos = platform.system() host = platform.node().lower().replace(".home.lan","") +if curos == "Windows": + log_path = "c:\\Program Files\\jaydee\\jaydee.log" +else: + log_path = "/tmp/mqtt_srv.log" + def writeLog(msg, svr="INFO"): ts = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") ts2 = datetime.datetime.now().strftime("%Y%m%d%H%M%S") @@ -83,11 +88,7 @@ def uptime(): return string; ts = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") ts2 = datetime.datetime.now().strftime("%Y%m%d%H%M%S") -if curos == "Windows": - log_path = "c:\\Program Files\\jaydee\\jaydee.log" -else: - log_path = "/tmp/mqtt_srv.log" - + if os.path.exists(log_path): shutil.move(log_path, log_path + "." + ts2)