Added Logging parameter in Config.toml to turn off or on the logging system.

This commit is contained in:
sarah committed 2026-04-06 00:11:24 +02:00
1 parent 332b071fab
commit 8ffcaadba5
2 files changed
+11 -9

No files matched your search

+7 -6
View File
@@ -207,12 +207,13 @@ def Dir(Path, Output = True, CopyConf = True):
def LogWrite(Text):
if (ConfDirs["LogDir"] != None and ConfNames != "Unset"):
if (ConfNames["LogFileName"] != None and ConfNames["LogFileName"] != "Unset"):
Dir(Parse(String = ConfDirs["LogDir"], Path = ConfPath), Output = False, CopyConf = False)
LogFile = f"{Parse(String = ConfDirs["LogDir"], Path = ConfPath)}/{Parse(String = ConfNames["LogFileName"], Path = ConfPath)}.log"
with open(LogFile, "a", encoding="utf-8", buffering=1) as File:
File.write(f"{Parse(String = ConfLog["All"], Path = ConfPath)}{Text}\n")
if (GetConf("Logging", ConfPath) == 1):
if (ConfDirs["LogDir"] != None and ConfNames != "Unset"):
if (ConfNames["LogFileName"] != None and ConfNames["LogFileName"] != "Unset"):
Dir(Parse(String = ConfDirs["LogDir"], Path = ConfPath), Output = False, CopyConf = False)
LogFile = f"{Parse(String = ConfDirs["LogDir"], Path = ConfPath)}/{Parse(String = ConfNames["LogFileName"], Path = ConfPath)}.log"
with open(LogFile, "a", encoding="utf-8", buffering=1) as File:
File.write(f"{Parse(String = ConfLog["All"], Path = ConfPath)}{Text}\n")
def DecideNewPath(FilePath):