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

Change logs extension to .log

This commit is contained in:
nxshock 2022-03-29 21:27:10 +05:00
parent 8784211f7b
commit 1db1c307d3

2
job.go
View File

@ -81,7 +81,6 @@ func (j *Job) Run() {
j.LastStartTime = startTime.Format(config.TimeFormat)
globalMutex.Unlock()
jobLogFile, _ := os.OpenFile(filepath.Join(config.LogFilesPath, j.Name+".txt"), os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644)
defer jobLogFile.Close()
defer jobLogFile.WriteString("\n")
@ -97,6 +96,7 @@ func (j *Job) Run() {
cmd := exec.Command(command, params...)
cmd.Stdout = jobLogFile
cmd.Stderr = jobLogFile
jobLogFile, _ := os.OpenFile(filepath.Join(config.LogFilesPath, j.Name+".log"), os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644)
err := cmd.Run()
if err != nil {