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:
parent
8784211f7b
commit
1db1c307d3
2
job.go
2
job.go
@ -81,7 +81,6 @@ func (j *Job) Run() {
|
|||||||
j.LastStartTime = startTime.Format(config.TimeFormat)
|
j.LastStartTime = startTime.Format(config.TimeFormat)
|
||||||
globalMutex.Unlock()
|
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.Close()
|
||||||
defer jobLogFile.WriteString("\n")
|
defer jobLogFile.WriteString("\n")
|
||||||
|
|
||||||
@ -97,6 +96,7 @@ func (j *Job) Run() {
|
|||||||
cmd := exec.Command(command, params...)
|
cmd := exec.Command(command, params...)
|
||||||
cmd.Stdout = jobLogFile
|
cmd.Stdout = jobLogFile
|
||||||
cmd.Stderr = 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()
|
err := cmd.Run()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user