I have created a class for logging of TagLib debug information

ivareske ivar_eskerud at hotmail.com
Sat Jan 15 22:07:45 CET 2011


I have created a class which helps keep track of the debug information
generated from TagLib. Could anyone add this to the next version of Taglib
(if you find it useful of course...) I`m making a GUI in Qt using TagLib,
and I can now show a log with all the TagLib debug information for each
specific file after reading the tags from a set of files. The class is a
singleton class within the TagLib namespace, which is only used one place,
in the void TagLib::debug(const String &s) function:

void TagLib::debug(const String &s)
{
  std::cerr << "TagLib: " << s << std::endl;

  DebugLogger::Instance()->append( "TagLib: " + s.to8Bit() );
}

All Strings being passed to this function is stored in the log. The user can
request the current log, and clear the log. Typically you clear the log,
read a file, and then request the log to get possible debug info for that
specific file. The class might need some polishing, but works fine for me.
The source file must be specified and the header specified among the install
files in the cmakelists.txt.
Hope someone finds it useful. 

Ivar

http://old.nabble.com/file/p30676133/DebugLogger.h DebugLogger.h 
http://old.nabble.com/file/p30676133/DebugLogger.cpp DebugLogger.cpp 
-- 
View this message in context: http://old.nabble.com/I-have-created-a-class-for-logging-of-TagLib-debug-information-tp30676133p30676133.html
Sent from the taglib-devel mailing list archive at Nabble.com.



More information about the taglib-devel mailing list