Backend update: Macro translation and refactor of saving and playing macros.

This commit is contained in:
Jesse Malotaux 2025-04-12 15:28:21 +02:00
parent 087d7eeca3
commit 266110a51f
10 changed files with 269 additions and 41 deletions

View file

@ -1,7 +1,6 @@
package app
import (
"fmt"
"log"
"os"
)
@ -10,13 +9,17 @@ var logFile *os.File
func MCRMLogInit() {
var err error
// Open or create the log file with append permissions
logFile, err = os.OpenFile("log.txt", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
if err != nil {
log.Fatal(err)
log.Fatal(err) // Exit if we can't open the log file
}
// Optionally set log to write to file in addition to standard log output
// log.SetOutput(logFile)
}
func MCRMLog(v ...interface{}) {
log.Println(v...)
fmt.Fprintln(logFile, v...)
log.Println(v...) // Logs to terminal as well
// fmt.Fprintln(logFile, v...) // Logs to log file
}