mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #690] All messages are sent to stdout, even errors, which should be in stderr. #393
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#393
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Apr 11, 2021).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/690
Librespot echoes everything into
stdout. This could be improved by properly echoing allINFOmessages to stdout and allWARNandERRORmessages to stderr.Currently, when I start librespot with:
I would expect all info messages redirected to
/dev/null, but still see any possible warnings or errors. However, this is not the case.This also breaks when using
systemdand specifying:With this configuration, all messages are in the
librespot.stdout.logfile.@roderickvd commented on GitHub (Apr 12, 2021):
I agree but this is not supported by the
env_loggercrate. It would require moving to some other crate or writing an own logger implementation.@Johannesd3 commented on GitHub (Apr 12, 2021):
First of all: AFAIK all log messages are printed to
stderr, notstdout. Which of us is wrong?I do not agree:
stderris in a way a misleading name, because it's not only intended for errors, but for all kind of status messages. E.g. curl will print the download progress tostderr(ifstdoutis redirected). Orbashwill show the$onstderr.stdoutis often used for that kind of output that is the purpose of the program, e.g. the list of files inls, the downloaded file incurl.And as a matter of fact, librespot uses already
stdoutfor another purpose: If the "pipe" backend is selected, the audio data will be passed tostdout. Considering this, your idea doesn't make so much sense anymore.If you just want to see errors and warning, use the
RUST_LOGenvironment variable. If you want to log all messages but see only errors, usegrepto filter the messages. Another advantage: If you use a single file, the order of messages will be preserved.@roderickvd commented on GitHub (Apr 12, 2021):
I stand corrected, you are right and was mistaken with logging levels. Which should work fine.
@coderootme you should use
2>/dev/nullsyntax to redirectstderr@ghost commented on GitHub (Apr 12, 2021):
Yes, guys, I am sorry. Everything goes to stderr. My point still stands, however, but it seems like you don't agree with that idea, so I will close it here.