On Sat, 11 Mar 2023 11:54:54 +0100, "Carlos E. R." <robin.listas@telefonica.net> wrote:
On 2023-03-11 06:02, Robert Webb wrote:
On Fri, 10 Mar 2023 21:47:32 -0600, J Leslie Turriff <jlturriff@mail.com> wrote:
I don't know about /var/log/warn, but a similar thing that bugs me is the noise that comes out of GUI programs that I start from the command line. Just about every one of them writes junk on the terminal, sometimes just because I'm scrolling a window(!) For the ones I use a lot I've written wrappers that consign stderr to /dev/null (which of course is dangerous because it also suppresses valid error messages.
I don't care about those, as I dedicate a separate terminal for those programs.
No kidding. I have this problem running GUI programs remotely. Carlos is not going to like my solution. I just say, "Let them spam the logs, instead of my terminal!" Here are the last two lines of my script:
#ssh -X "$DEST_SPEC" "$1"' >/dev/null 2>&1' ssh -X "$DEST_SPEC" systemd-cat -t "$Cmd" -- "$@" &
You can see from the commented-out line, I was doing something similar before deciding to send the abuse to the logs. 'systemd-cat' captures both stdout and stderr. I'm a happy camper now. (Let's have a special mention for gwenview here.)
I'm not familiar with that program and syntax, but as long as you don't spam the warning long, I'm fine.
Doesn't systemd-cat need a '|'?
It can run either way, accepting input from a pipe, or running a program as a wrapper, capturing stdout and stderr.
You can make use of "--priority=...". Default is "info", which is fine.
I would have preferred setting different priorities for stdout and stderr, but then ordering of message lines can get messed up.
Interestingly, the program is missing "--facility=..."
But there is "--identifier=..." (-t), which can be used to filter messages. -- Robert Webb