task icon indicating copy to clipboard operation
task copied to clipboard

Allow only actual errors to be outputted to stderr (taskfile thus on stdout)

Open hans-d opened this issue 1 year ago • 2 comments
trafficstars

when now running task, the task specific out (task: ) is outputted to stderr. Would be good to have an option have this outputted on stdout, so stderr is only for actual errors

hans-d avatar Dec 15 '23 11:12 hans-d

Hi @hans-d,

As far I understand, stderr is not exclusive for errors. By convention stderr usually outputs logs in general, while stdout is for actual ("useful") application output. Given these Task outputs are considered logs, that's why they go to stderr.

Do you have an specific reason for wanting that to change?

andreynering avatar Dec 21 '23 01:12 andreynering

Default behaviour should stay as is, but for some cases I want to capture the errors from underlying commands executed, and the tracing of task in separate streams. Eg using this in pipelines to have a quick report of "the error", and a longer more detailed section with all the regular log output. Yes, I can use some grep here, but rather would not rely on that.

hans-d avatar Dec 22 '23 09:12 hans-d