1
0
mirror of https://github.com/nxshock/gron.git synced 2024-11-27 03:41:00 +05:00
gron/log.go

26 lines
434 B
Go
Raw Normal View History

2022-03-26 13:23:39 +05:00
package main
import (
2022-05-11 18:59:33 +05:00
"fmt"
2022-03-26 13:23:39 +05:00
"os"
)
2022-05-11 18:59:33 +05:00
type logFile struct{ file *os.File }
func (lf *logFile) Printf(format string, v ...interface{}) {
fmt.Fprintf(lf.file, format, v...)
}
func (lf *logFile) Println(v ...interface{}) {
fmt.Fprintln(lf.file, v...)
}
var mainLogFile *os.File
2022-03-26 13:23:39 +05:00
func initLogFile() error {
2022-03-26 13:23:39 +05:00
var err error
2022-05-11 18:59:33 +05:00
mainLogFile, err = os.OpenFile(config.LogFilePath, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644)
return err
2022-03-26 13:23:39 +05:00
}