F1bonacc1 / process-compose

Process Compose is a simple and flexible scheduler and orchestrator to manage non-containerized applications.
https://f1bonacc1.github.io/process-compose/
Apache License 2.0
1.34k stars 52 forks source link

Print log write errors to stderr rather than stdout #216

Closed ysndr closed 3 months ago

ysndr commented 3 months ago

Currently the write error message emitted by process-compose process logs --tail is indistinguishable from actual log output coming from the process.

processes:
  never_exit:
    command: sleep infinity
  foo:
    command: |
      echo 1
      echo 2
      echo 3

will log as:

$ process-compose process logs -u test.sock -n 2 foo 2>/dev/null
2
3
write close: write unix ->test.sock: write: broken pipe

This change will make it so that write close: write unix ->test.sock: write: broken pipe would be printed to stderr, i.e. the same command as above would log as:

$ process-compose process logs -u test.sock -n 2 foo 2>/dev/null
2
3
sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud