mirror of
https://github.com/nxshock/gron.git
synced 2024-11-27 03:41:00 +05:00
26 lines
434 B
Go
26 lines
434 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
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
|
|
|
|
func initLogFile() error {
|
|
var err error
|
|
mainLogFile, err = os.OpenFile(config.LogFilePath, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644)
|
|
|
|
return err
|
|
}
|