mirror of
https://github.com/Macrame-App/Macrame
synced 2025-12-29 07:19:26 +00:00
Logging update
This commit is contained in:
parent
541f016eaf
commit
2098aface9
13 changed files with 119 additions and 91 deletions
22
be/app/log.go
Normal file
22
be/app/log.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package app
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
||||
var logFile *os.File
|
||||
|
||||
func MCRMLogInit() {
|
||||
var err error
|
||||
logFile, err = os.OpenFile("log.txt", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func MCRMLog(v ...interface{}) {
|
||||
log.Println(v...)
|
||||
fmt.Fprintln(logFile, v...)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue