i-rinat / apulse

PulseAudio emulation for ALSA
MIT License
609 stars 35 forks source link

trace: trace to stderr #79

Closed oxij closed 6 years ago

oxij commented 6 years ago

It's a bad idea to write debug output to stdout, it gets lost there.

i-rinat commented 6 years ago

Why do you want to put debug messages to standard error stream? Error messages are already being sent to the stderr, as well as to the stdout.

oxij commented 6 years ago

This duplicates error messages. There is already fprintf() that writes to stderr half a dozen lines earlier.

Oops, right.

being sent to the stderr, as well as to the stdout.

Yes, this is incorrect in that it duplicates the messages. I made this patch with sed :)

However, my problem with the state before this patch is that since some messages get sent to stdout instead of stderr, apps that draw with ncurses get pretty ugly with tracing enabled. And the ncurses' redraws erase the debugging info from the view.

I think everything should always be sent to stderr.

oxij commented 6 years ago

Also, a little thing I made you might be interested in: https://github.com/oxij/libcardiacarrest Unrelated to this PR but strongly related to apulse.

i-rinat commented 6 years ago

I don't like the idea of using stderr exclusively. It definitely will be an inconvenience for me during coding/debugging.

But still, I pushed 0bd2288d7cae26876ecb44e22d9f188dee6c41d5 to the master branch. It's not what you wanted to merge, but if you want to log to the stderr, you need to patch only the line where log_to_stderr flag is set.

I think it's possible to make it configurable at run time. Haven't decided how yet.

i-rinat commented 6 years ago

you might be interested in: https://github.com/oxij/libcardiacarrest

Sometimes I regret I made apulse available. For some reason some people believe that I share their hatred towards PulseAudio. Which is not the case.

oxij commented 6 years ago

I think it's possible to make it configurable at run time. Haven't decided how yet.

I would be perfectly happy with an official compile time option I can use when packaging, like "-DLOG_TO_STDERR=1" or something similar.

you might be interested in: https://github.com/oxij/libcardiacarrest

Sometimes I regret I made apulse available. For some reason some people believe that I share their hatred towards PulseAudio. Which is not the case.

I find it hard to believe that one can read PA's source and still be like "nah, its fine, it totally makes sense". But, well, okay, opinion noted, I guess.

I think libcardiacarrest provides useful service even if you don't hate PA, though.

i-rinat commented 6 years ago

like "-DLOG_TO_STDERR=1"

Why not. Added in 0be73093ee7996d4470c01fd152029bdf61ddaf0.

I find it hard to believe that one can read PA's source and still be like "nah, its fine, it totally makes sense".

You didn't look into apulse's source code, did you? :grinning:

oxij commented 6 years ago

Rinat Ibragimov notifications@github.com writes:

Why not. Added in 0be73093ee7996d4470c01fd152029bdf61ddaf0.

Perfect. Thank you. You can close this, or I will the next time I login into GitHub.

You didn't look into apulse's source code, did you? :grinning:

I did. The lack of library-to-daemon protocol handling makes this considerably better.