• spiiroin's avatar
    [debug] Optionally include file/line/function info when logging to stderr · 3420f50a
    spiiroin authored
    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: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
usb_moded-log.h 2.63 KB