psadmin-io / psadmin-plus

A psadmin helper script
MIT License
17 stars 4 forks source link

psadmin Output Processing #114

Open iversond opened 1 year ago

iversond commented 1 year ago

This PR has a number of changes to how output from psadmin is processed. psadmin mixes messages between stdout and stderr (often with normal information in stderr). This PR now offers 3 levels of output you can choose:

PS_PSA_OUTPUT

There are some new environment variables to control the output behavior:

The other big change is moving command execution into a new Runner class. This simplifies processing psadmin output by only having a single execution point. The runner uses Open3.popen3 to execute OS commands, and within the wait_thread we can decide how we process stdout and stderr. For summary and quiet output, we handle the output after the command has completed rather than stream stdout and stderr.

Fixes these issues: #107, #102, #71 Some changes for #88 but still didn't resolve issue