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

[Bug] daemon version warning is written to stdout, not stderr #562

Closed
mjpieters opened this issue Aug 2, 2024 · 5 comments · Fixed by #566
Closed

[Bug] daemon version warning is written to stdout, not stderr #562

mjpieters opened this issue Aug 2, 2024 · 5 comments · Fixed by #566
Labels

Comments

@mjpieters
Copy link
Contributor

Describe the bug

When client and daemon versions differ, all output except for JSON output is prepended with

Different daemon version detected '{version}'. Consider restarting the daemon.

This message is written to stdout, which means it can't easily be filtered out.

Steps to reproduce

Run the daemon as version 3.4.0, then use client version 3.4.1 and use --print-task-id to only get the task ID to be output:

$ pueue add --print-task-id 'echo hello' 2>/dev/null
Different daemon version detected '3.4.0'. Consider restarting the daemon.
1

The expected output would be 1, with Different daemon version detected '3.4.0'. Consider restarting the daemon. having been redirected to /dev/null.

Debug logs (if relevant)

No response

Operating system

Debian 10

Pueue version

3.4.0 (daemon) and 3.4.1 (client)

Additional context

At the very least, the message should be written to stderr. Ideally, it should be possible to disable it altogether (pueue --no-warnings add ...).

@Nukesor
Copy link
Owner

Nukesor commented Aug 3, 2024

Thinking about it, all logs should probably be sent to stderr and the same should probably be true for pueued as well?

@mjpieters
Copy link
Contributor Author

Thinking about it, all logs should probably be sent to stderr and the same should probably be true for pueued as well?

Hard to say. Generally speaking, 'out of band' information should go to stderr. When I run pueue log <TASKID> the goal is to get the log output of a task, so that should go to stdout. Anything else should go to stderr.

@Nukesor
Copy link
Owner

Nukesor commented Aug 8, 2024

Ah yep. By logs I meant all of the stuff that's printed when pueue/d is called with -v/v/v

pueue log should definitely be put to stdout

@Nukesor
Copy link
Owner

Nukesor commented Aug 24, 2024

The linked MR sends all log output to stderr and sends an error log message in case of version incompatibilities.

I'm not sure about the error-level "version incompatiblity" message though. It feels more like a warning, but the default log level is error. Maybe the default log level for the client should be bumped to warning?

@mjpieters
Copy link
Contributor Author

Yes, that's a warning level message. What other warning-level log output could the client produce? I'd review that and bump the level to warning if there isn't too much else that'd show up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants