libcaption icon indicating copy to clipboard operation
libcaption copied to clipboard

Print debug output to stderr in vtt.c

Open alumae opened this issue 4 years ago • 5 comments

Fixes issue #55

alumae avatar Jun 04 '20 07:06 alumae

Polluting to stderr from a library isn't much better than polluting stdout.

A real solution would be to have an API to provide a logging callback and opaque user pointer to pass to that callback.

dwbuiten avatar Jun 04 '20 12:06 dwbuiten

If a program outputs actual data to stdout, then "polluting" stderr is the only option. This fix was made because the example program flv+srt can output the processed media stream to stdout. If stdout also contains debug messages, the resulting stream will be invalid.

alumae avatar Jun 04 '20 19:06 alumae

This is untrue. stderr is not the only option - did you read what I wrote? I provided exactly what the correct option is.

dwbuiten avatar Jun 04 '20 19:06 dwbuiten

Yes, you are right. I should have rewritten the library that I used today for the first time, that I needed for a small thing, by implementing an API with callbacks and user pointers. Thank you for pointing out what is exactly the correct option.

alumae avatar Jun 04 '20 19:06 alumae

I merely contested that it was the "only" option, which is what you said. Please settle down.

I think if you have no interest in correcting the behavior, it is preferable to comment out or remove them instead - @szatmary's approval pending, of course.

dwbuiten avatar Jun 04 '20 19:06 dwbuiten