mirror of
https://git.srhtnin.garden/sarah/SaraSortd.git
synced 2026-10-13 18:38:11 +02:00
Added Logging parameter in Config.toml to turn off or on the logging system.
This commit is contained in:
1 parent
332b071fab
commit
8ffcaadba5
2 files changed
+11
-9
No files matched your search
+4
-3
@@ -4,6 +4,7 @@ SafeMode = 1
|
|||||||
SilentMode = 0
|
SilentMode = 0
|
||||||
CheckInput = 3
|
CheckInput = 3
|
||||||
DotFiles = 0
|
DotFiles = 0
|
||||||
|
Logging = 1
|
||||||
|
|
||||||
[Variables]
|
[Variables]
|
||||||
NextNum = "!"
|
NextNum = "!"
|
||||||
@@ -20,9 +21,9 @@ Second = "[s]"
|
|||||||
VarCall = "%%"
|
VarCall = "%%"
|
||||||
|
|
||||||
[DirectoryPaths]
|
[DirectoryPaths]
|
||||||
RootDir = ["Unset"]
|
RootDir = "Unset"
|
||||||
InputDir = [ "%RootDir%",]
|
InputDir = [ "%RootDir%"]
|
||||||
OutputDir = [ "%RootDir%/Output",]
|
OutputDir = [ "%RootDir%/Output"]
|
||||||
LogDir = "%RootDir%/.Logs"
|
LogDir = "%RootDir%/.Logs"
|
||||||
FailedDir = "%RootDir%/.Failed"
|
FailedDir = "%RootDir%/.Failed"
|
||||||
|
|
||||||
|
|||||||
+7
-6
@@ -207,12 +207,13 @@ def Dir(Path, Output = True, CopyConf = True):
|
|||||||
|
|
||||||
|
|
||||||
def LogWrite(Text):
|
def LogWrite(Text):
|
||||||
if (ConfDirs["LogDir"] != None and ConfNames != "Unset"):
|
if (GetConf("Logging", ConfPath) == 1):
|
||||||
if (ConfNames["LogFileName"] != None and ConfNames["LogFileName"] != "Unset"):
|
if (ConfDirs["LogDir"] != None and ConfNames != "Unset"):
|
||||||
Dir(Parse(String = ConfDirs["LogDir"], Path = ConfPath), Output = False, CopyConf = False)
|
if (ConfNames["LogFileName"] != None and ConfNames["LogFileName"] != "Unset"):
|
||||||
LogFile = f"{Parse(String = ConfDirs["LogDir"], Path = ConfPath)}/{Parse(String = ConfNames["LogFileName"], Path = ConfPath)}.log"
|
Dir(Parse(String = ConfDirs["LogDir"], Path = ConfPath), Output = False, CopyConf = False)
|
||||||
with open(LogFile, "a", encoding="utf-8", buffering=1) as File:
|
LogFile = f"{Parse(String = ConfDirs["LogDir"], Path = ConfPath)}/{Parse(String = ConfNames["LogFileName"], Path = ConfPath)}.log"
|
||||||
File.write(f"{Parse(String = ConfLog["All"], Path = ConfPath)}{Text}\n")
|
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):
|
def DecideNewPath(FilePath):
|
||||||
|
|||||||
Reference in new issue
Block a user