1
0
mirror of https://github.com/go-task/task.git synced 2025-11-25 22:32:55 +02:00

Include task name in log output

This commit is contained in:
George Pollard
2020-11-06 09:27:42 +13:00
committed by Andrey Nering
parent d44207dd7f
commit fe917affd2
3 changed files with 5 additions and 3 deletions

View File

@@ -366,7 +366,7 @@ func (e *Executor) runCommand(ctx context.Context, t *taskfile.Task, call taskfi
return nil
case cmd.Cmd != "":
if e.Verbose || (!cmd.Silent && !t.Silent && !e.Taskfile.Silent && !e.Silent) {
e.Logger.Errf(logger.Green, "task: %s", cmd.Cmd)
e.Logger.Errf(logger.Green, "task: [%s] %s", t.Name(), cmd.Cmd)
}
if e.Dry {
@@ -397,7 +397,7 @@ func (e *Executor) runCommand(ctx context.Context, t *taskfile.Task, call taskfi
Stderr: stdErr,
})
if execext.IsExitError(err) && cmd.IgnoreError {
e.Logger.VerboseErrf(logger.Yellow, "task: command error ignored: %v", err)
e.Logger.VerboseErrf(logger.Yellow, "task: [%s] command error ignored: %v", t.Name(), err)
return nil
}
return err