Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

actualizer logs non-error messages to stderr #2975

Closed
candrews opened this issue May 15, 2020 · 1 comment · Fixed by #2979
Closed

actualizer logs non-error messages to stderr #2975

candrews opened this issue May 15, 2020 · 1 comment · Fixed by #2979
Milestone

Comments

@candrews
Copy link
Contributor

#2964 caused a change in actualizer behavior regarding logging.

actualizer used to write informational, non-error messages to stdout. Now it writes this to stderr.

These outputs:
FreshRSS starts feeds actualization at...
FreshRSS actualize <user>
FreshRSS actualization done for...
are all informative so they should go to stdout, not stderr.

Using stdout vs stderr is important because systems like cron will alert root if a scheduled job logs output to stderr.

@Alkarex Alkarex added this to the 1.16.1 milestone May 15, 2020
Alkarex added a commit to Alkarex/FreshRSS that referenced this issue May 15, 2020
@Alkarex
Copy link
Member

Alkarex commented May 15, 2020

Thanks for testing /master, @candrews 👍
You are right, I am reverting. Please see #2979

It is actually unfortunate that some cron jobs by default are testing stderr instead of testing exit code.
In our other CLI scripts, STDOUT is used for data, STDERR for various diagnostic messages.
See (e.g. for a suggestion of code to check exit code):

https://www.jstorimer.com/blogs/workingwithcode/7766119-when-to-use-stderr-instead-of-stdout

stderr is also the place where you print stuff like help docs when an invalid argument is passed to a command. In this case its help docs should be printed, but not be passed on to the next program.

Alkarex added a commit that referenced this issue May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants