mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
refactor and to go mod
This commit is contained in:
24
server/log/log.go
Normal file
24
server/log/log.go
Normal 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...)
|
||||
}
|
||||
Reference in New Issue
Block a user