Eric Westbrook wrote:
> VERY helpful! Thanks! Definitely set me on the right road there. Appreciate it.
>
> I've started some man page editing "
here"
>
> I've also discovered why I didn't see any log messages.
>
> Log messages are indeed being queued "
here" but there's no flush of that queue before exit() is called, which means that tvhlog_process() is never actually called to output the messages.
>
> I confirmed this by undefining TVHLOG_THREAD "
here" after which I can see the messages when this error is triggered. But I assume it's better to flush the queue before exit, rather than defeating the log threading entirely.
>
> What's the "proper" call to flush that queue, then? Should I do so directly before the exit(78), or would it be better to create a new wrapper for exit(), which flushes that queue first, that other callers of exit() can use for the same benefit?
>
> I'd like to fix it the "right" way, whichever that should be.
>
> Thanks again! Advice appreciated.
>
> PS - Updated my name, too.
I'm no C dev (I'm more a PHP/Python guy), so mostly just guess how the code works. You however appear to understand it a lot more than I do. If you can, please do consider PRing any improvements to Tvheadend. The more people working on it, the better it gets for everyone!