[debug] Optionally include file/line/function info when logging to stderr
When debugging usb-moded it is time consuming to find where the
various debug messages originate from.
When logging to stderr, prefix the messages with source code
position info similar as gcc uses for reporting compilation
issues. This allows browsing usb-moded code with jump to the
next error functionality available in many text editors.
Since the amount of information passed to logging functions
is significantly increased, check whether the message would
be emitted or not before evaluating formatting parameters etc.
Also make variables relating to logging level, type, etc
available only via accessor functions.
Signed-off-by:
Simo Piiroinen <simo.piiroinen@jollamobile.com>
Showing
Please register or sign in to comment