Project

General

Profile

Feature #932

printf prefix

Added by Pascal de Bruijn about 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
miscellaneous
Start date:
28 Oct 2013
Due date:
% Done:

0%

Estimated time:

Description

Currently when applications use libexiv2, they may have stuff printed on the terminal like so:

Error: Directory Nikon1 with 25665 entries considered invalid; not read.
Error: Directory Nikon1 with 25665 entries considered invalid; not read.
Error: Directory Nikon1 with 25665 entries considered invalid; not read.

This often confuses users into thinking the main application is printing those messsages. Considering that many applications use multiple libraries for all sorts of things, these unidentified printfs can become quite messy indeed.

Ideally we'd like to be able to set a property in the library where everything the library prints is prefixed with a string set by the application, for example in our case like so:

[exiv2] Error: Directory Nikon1 with 25665 entries considered invalid; not read.
[exiv2] Error: Directory Nikon1 with 25665 entries considered invalid; not read.
[exiv2] Error: Directory Nikon1 with 25665 entries considered invalid; not read.

In this case the prefix string would be set to '[exiv2] ' (please take notice of the space in the string, which means an empty prefix string would give the exact same result as the current output).

History

#1

Updated by Andreas Huggel almost 8 years ago

  • Status changed from New to Closed

An application can do this and much more quite easily by setting its own log message handler. See #476 and class Exiv2::LogMsg

Also available in: Atom PDF