refactor and to go mod

This commit is contained in:
YouROK
2021-02-18 16:56:55 +03:00
parent 0e49a98626
commit 94f212fa75
50 changed files with 13 additions and 29 deletions

24
server/log/log.go Normal file
View File

@@ -0,0 +1,24 @@
package log
import (
"log"
"os"
)
func Init(path string) {
if path != "" {
ff, err := os.Create(path)
if err != nil {
TLogln("Error create log file:", err)
return
}
os.Stdout = ff
os.Stderr = ff
log.SetOutput(ff)
}
}
func TLogln(v ...interface{}) {
log.Println(v...)
}