add log file close back

This commit is contained in:
Darius 2024-05-09 23:34:39 +02:00
parent 7ac4686344
commit 184622988d
2 changed files with 13 additions and 0 deletions

View File

@ -20,6 +20,18 @@ func OpenLogFile(BasePath string) {
} }
} }
func CloseLogFile() {
_, err := logFile.WriteString(
"\n\n#######################################\n## CLOSE ##" +
"\n" + time.Now().String() +
"\n#######################################\n",
)
if err != nil {
panic(err)
}
logFile.Close()
}
func Log(message string) { func Log(message string) {
if _, err := logFile.WriteString("\n" + message + ": " + time.Now().String()); err != nil { if _, err := logFile.WriteString("\n" + message + ": " + time.Now().String()); err != nil {
panic(err) panic(err)

View File

@ -20,4 +20,5 @@ func main() {
notification.SendNtfy(inputParams) notification.SendNtfy(inputParams)
} }
} }
log.CloseLogFile()
} }