mirror of
https://github.com/Macrame-App/Macrame
synced 2025-12-29 07:19:26 +00:00
Backend update: Macro translation and refactor of saving and playing macros.
This commit is contained in:
parent
087d7eeca3
commit
266110a51f
10 changed files with 269 additions and 41 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue