Feature #476
Error handler: Applications should be able to register an error handler
Start date:
Due date:
% Done:
100%
Estimated time:
Description
Allow applications to register a callback function which is used to process warnings and errors from the library.
Related issues
Associated revisions
History
Updated by Andreas Huggel over 11 years ago
Related comments: http://dev.exiv2.org/boards/3/topics/569
Updated by Andreas Huggel about 11 years ago
- Status changed from New to Resolved
- Target version set to 0.21
- % Done changed from 0 to 100
Applications can provide their own log message handler now. See the new class Exiv2::LogMsg
(error.hpp) for details
void newHandler(int lvl, const char* msg) { printf("The message is: %s (level %d)\n", msg, lvl); } Exiv2::LogMsg::setHandler(newHandler);
#476, #614: Introduced class LogMsg for enhanced logging, migrated all existing warnings and error messages (not the exceptions) to use the new logic. Every log message now has a type (debug, info, warning, error). Applications can set a logging level to determine which messages are processed and supply a custom log message handler at runtime. (Based on a contribution by Simson Garfinkel.)