From 1cbca5b0e3acf17784e2c51286f27eb6dcef23d3 Mon Sep 17 00:00:00 2001 From: nxshock Date: Sat, 14 May 2022 14:17:30 +0500 Subject: [PATCH] Add LogWriter to add timestamps for job logs --- log.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/log.go b/log.go index 7e13ec5..1f6b4d9 100644 --- a/log.go +++ b/log.go @@ -1,18 +1,19 @@ package main import ( - "fmt" "os" + + "github.com/nxshock/logwriter" ) -type logFile struct{ file *os.File } +type LogWriter struct{ w *logwriter.LogWriter } -func (lf *logFile) Printf(format string, v ...interface{}) { - fmt.Fprintf(lf.file, format, v...) +func (lw *LogWriter) Printf(format string, v ...interface{}) { + lw.w.Printf(format, v...) } -func (lf *logFile) Println(v ...interface{}) { - fmt.Fprintln(lf.file, v...) +func (lw *LogWriter) Println(v ...interface{}) { + lw.w.Println(v...) } var mainLogFile *os.File