mirror of
https://gitlab.sectorq.eu/jaydee/mqtt_srv.git
synced 2025-12-14 10:34:53 +01:00
klal
This commit is contained in:
11
mqtt_srv.py
11
mqtt_srv.py
@@ -32,6 +32,11 @@ VERSION = "1.0.37"
|
|||||||
|
|
||||||
curos = platform.system()
|
curos = platform.system()
|
||||||
host = platform.node().lower().replace(".home.lan","")
|
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"):
|
def writeLog(msg, svr="INFO"):
|
||||||
ts = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
ts = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||||
ts2 = 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;
|
return string;
|
||||||
ts = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
ts = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||||
ts2 = 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):
|
if os.path.exists(log_path):
|
||||||
shutil.move(log_path, log_path + "." + ts2)
|
shutil.move(log_path, log_path + "." + ts2)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user