jirutka / apk-autoupdate

Automatic updates for Alpine Linux and other systems using apk-tools
MIT License
53 stars 11 forks source link

All messages are output to stderr #7

Open teeuwen opened 3 years ago

teeuwen commented 3 years ago

I noticed all messages, regardless of their importance are redirected to stderr.

This bother me because I've set up a cronjob for apk-autoupdate to run every day like so:

MAILTO=example@example.com
0       2       *       *       *       /usr/sbin/apk-autoupdate > /dev/null

I would expect "Checking available updates..." to be redirected to /dev/null accordingly. Right now, I get an email every day telling me that apk-autoupdate is checking for available updates.

Eeems commented 2 months ago

Instead of piping to /dev/null, you could use chronic to only output on failure: https://manpages.ubuntu.com/manpages/trusty/man1/chronic.1.html

fossdd commented 2 months ago

This is also a good idea. Nevertheless I opened #17 which should output INFO messages like Checking available updates... to stdout.

fossdd commented 3 weeks ago

Hmm, after thinking about it. I'm not sure if outputting INFO to stdout makes sense. Often all diagnostic output is written to stderr, including info messages. Maybe a info level variable would make here more sense?

@jirutka what do you think about it?