Skip to content

Commit

Permalink
[logging] Allow printf style logging similarly as qDebug() does
Browse files Browse the repository at this point in the history
Use variadic macros to allow calls like:
  sensordLogT("foo=%d", bar);

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Sep 26, 2018
1 parent 8bd068f commit 4fb1461
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/logging.h
Expand Up @@ -29,9 +29,9 @@

#include <QDebug>

#define sensordLogT() (qDebug())
#define sensordLogD() (qInfo())
#define sensordLogW() (qWarning())
#define sensordLogC() (qCritical())
#define sensordLogT(ARGS_...) (qDebug(ARGS_))
#define sensordLogD(ARGS_...) (qInfo(ARGS_))
#define sensordLogW(ARGS_...) (qWarning(ARGS_))
#define sensordLogC(ARGS_...) (qCritical(ARGS_))

#endif //LOGGING_H

0 comments on commit 4fb1461

Please sign in to comment.