[x265] [PATCH 1 of 2] Add support for customizing logging

Derek Buitenhuis derek.buitenhuis at gmail.com
Mon Mar 19 16:50:21 CET 2018


On 3/18/2018 10:29 PM, Andrey Semashev wrote:
> Normally, there is only one _application_. There may be multiple 
> _libraries_ using libx265 but none of them should be configuring its 
> logging, unless it is supposed to be the only one using libx265 in the 
> application (and generic libraries cannot make that assumption). It is 
> the application that should configure logging in every component it uses.

That's a lot of 'should' that relies on different API users doing the
'right thing'...

> 
> That said, I myself would prefer to configure logging on per-encoder 
> basis, although for different reasons. But the way x265 is currently 
> written does not allow this because in many places logging is done 
> without any encoder context. I'm not willing to rewrite x265 to support 
> this as global logging customization is "good enough" for me. It 
> certainly is much better than unconditionally logging to stdout.

It is indeed a lot of work to do properly. It is up to x265 whether they
prefer this amount of work, or to add the implementation as it currently
is and support that API for however long they need to.

>> Further, defining user types ending in _t is not allowed in C (which this
>> header is, and is used from), and x265 does not do this.
> 
> I'm not aware of this limitation. In particular, C11 section 7.1.3 
> contains no such restriction. Can you provide a reference to the part of 
> the C standard that says this?

Sorry, I meant POSIX, see: B.2.12 Data Types. Yes, POSIX is quite relevant
still.

- Derek


More information about the x265-devel mailing list