netblue30 / firejail

Linux namespaces and seccomp-bpf sandbox
https://firejail.wordpress.com
GNU General Public License v2.0
5.81k stars 567 forks source link

Rework quiet, debug and normal console output #4275

Open rusty-snake opened 3 years ago

rusty-snake commented 3 years ago

We have multiple issues about how we print something to the console, which all go to the same code. Therefore I make this meta-issue.

There are some more which aren't handled here like:


Good to read:

IMHO we should only print warnings and errors to stderr by default and be quiet for everything else. The current quiet would be then a hard-queit if a program really need full ownership of stderr. In addition a --info/--verbose/--debug=1/--debug=little/whatever will show the current default output.

All the warnings/errors should make clear that they are printed by firejail (e.g. firejail:Error:).

For the debug output it would be enough to print something like

--- end of firejail output ---
glitsj16 commented 3 years ago

All the warnings/errors should make clear that they are printed by firejail (e.g. firejail:Error:).

This reminds me of #3325, which never really got of the ground. @topimiettinen mentioned a possibility to improve errExit() and use it everywhere with a prefix. IMO that would solve this part of the issue. Just adding it here for future reference.

slowpeek commented 3 years ago

I'm not sure is there a single reason to use stdout in firejail. It is a wrapper, hence it should not touch neither stdin nor stdout.