catching taglib debug information

Jim jmartin92 at comcast.net
Tue Jul 13 16:59:16 CEST 2010


Lukáš Lalinský wrote:
> On Tue, Jul 13, 2010 at 2:02 PM, Ivar Eskerud Smith
> <ivar_eskerud at hotmail.com> wrote:
>> Hi, I`m not sure if this is the cirect place to post suport/help questions,
>> but:
>>
>> Does anyone know if there is there a way to catch the debug information
>> given by taglib when constructing a fileref (like 'MPEG::Header::parse() --
>> Invalid sample rate.') ?
> 
> I'm afraid you can't catch it. If you just want to disable it, you
> should compile TagLib in release mode (so that the NDEBUG macro is
> defined), in which these information is compiled out.
> 
> Lukas

If he is using TagLib compiled in one of the debug modes (where NDEBUG isn't 
defined), couldn't he redirect std::cerr to "catch" at least some of the debug 
information?  That's assuming all he wants is to have that saved to a file or 
something like that.  Or he could redefine debug & debugData in tdebug.h and 
write his own versions of those functions?  (I know, a messy solution if it 
would work at all.)

On a related note, should the debugData function be using std::cout or std::cerr?

Jim


More information about the taglib-devel mailing list