mirror of
https://github.com/nxshock/gron.git
synced 2024-11-27 03:41:00 +05:00
27 lines
457 B
Go
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
|
|
}
|