Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit f247984

Browse files
committed
Improve info logging in task mode
1 parent 786a0c2 commit f247984

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cmd/task.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func task(parseFlags bool, c chan int) func(cmd *cobra.Command, args []string) e
4545
}
4646
err := worker.PayloadFromJSON(&p)
4747
if err != nil {
48-
fmt.Printf("[siderite] failed to read payload from JSON: %v\n", err)
48+
_, _ = fmt.Fprintf(os.Stderr, "[siderite] failed to read payload from JSON: %v\n", err)
4949
return err
5050
}
5151

@@ -58,20 +58,20 @@ func task(parseFlags bool, c chan int) func(cmd *cobra.Command, args []string) e
5858
defer deferFunc()
5959
}
6060
if err != nil {
61-
fmt.Printf("[siderite] logger disabled: %v\n", err)
61+
_, _ = fmt.Fprintf(os.Stderr, "[siderite] logger disabled: %v\n", err)
6262
}
6363

6464
_, _ = fmt.Fprintf(os.Stderr, "[siderite] task version %s start\n", GitCommit)
6565

6666
if len(p.Version) < 1 || p.Version != "1" {
67-
fmt.Printf("[siderite] unsupported or unknown payload version: %s\n", p.Version)
67+
_, _ = fmt.Fprintf(os.Stderr, "[siderite] unsupported or unknown payload version: %s\n", p.Version)
6868
}
6969
if len(p.Cmd) < 1 {
70-
fmt.Printf("[siderite] missing command\n")
70+
_, _ = fmt.Fprintf(os.Stderr, "[siderite] missing command\n")
7171
return fmt.Errorf("missing command")
7272
}
7373

74-
fmt.Printf("[siderite] executing: %s %v\n", p.Cmd[0], p.Cmd[1:])
74+
_, _ = fmt.Fprintf(os.Stderr, "[siderite] executing: %s %v\n", p.Cmd[0], p.Cmd[1:])
7575
command := exec.Command(p.Cmd[0], p.Cmd[1:]...)
7676
command.Stdout = os.Stdout
7777
command.Stderr = os.Stderr

0 commit comments

Comments
 (0)