1
0
mirror of https://github.com/nxshock/gron.git synced 2024-11-27 03:41:00 +05:00
gron/log.go
nxshock 1cbca5b0e3 Add LogWriter
to add timestamps for job logs
2022-05-14 14:17:30 +05:00

27 lines
457 B
Go

package main
import (
"os"
"github.com/nxshock/logwriter"
)
type LogWriter struct{ w *logwriter.LogWriter }
func (lw *LogWriter) Printf(format string, v ...interface{}) {
lw.w.Printf(format, v...)
}
func (lw *LogWriter) Println(v ...interface{}) {
lw.w.Println(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
}