zarf-dev / zarf

DevSecOps for Air Gap & Limited-Connection Systems. https://zarf.dev/
Apache License 2.0
1.42k stars 172 forks source link

Send PTerm tables to os.Stdout not logger.DefaultDestination #3223

Open mkcp opened 2 weeks ago

mkcp commented 2 weeks ago

Is your feature request related to a problem? Please describe.

This is rly more of a bug that I started doing while I was adding in structured logs. Tables needed to be reinitialized when pterm is feature flagged off -- when I put this hack together I passed them logger.DefaultDestination which happens to be stderr.

Describe the behavior you'd like

Sending tables that are definitely "output for users" to stderr isn't very unixy, so let's instead send them to stdout. Let's also declare the writer outside of logger. These are similar but not the same components, so there's no need to use a logger type for output.

Most if not all of of these table prints are well contained to the cmd layer. Here's some examples, this should not be considered an exhaustive list:

Additional context

Ideally we don't have to use this re-initialize hack at all, but that may have to be in scope for a future issue.