~gerboland/qtubuntu/enable-debug-mode

« back to all changes in this revision

Viewing changes to src/ubuntumirclient/logging.h

  • Committer: Gerry Boland
  • Date: 2016-04-12 13:10:43 UTC
  • mfrom: (280.2.34 enable-debug-mode)
  • Revision ID: gerry.boland@canonical.com-20160412131043-t14zmcbheuxclmhr
Merge lp:~dandrader/qtubuntu/enable-debug-mode, he kindly fixed merging this with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2014 Canonical, Ltd.
 
2
 * Copyright (C) 2014-2015 Canonical, Ltd.
3
3
 *
4
4
 * This program is free software: you can redistribute it and/or modify it under
5
5
 * the terms of the GNU Lesser General Public License version 3, as published by
17
17
#ifndef QUBUNTULOGGING_H
18
18
#define QUBUNTULOGGING_H
19
19
 
20
 
// Logging and assertion macros.
21
 
#define LOG(...) qDebug(__VA_ARGS__)
22
 
#define LOG_IF(cond,...) do { if (cond) qDebug(__VA_ARGS__); } while(0)
 
20
#include <QLoggingCategory>
 
21
 
23
22
#define ASSERT(cond) ((!(cond)) ? qt_assert(#cond,__FILE__,__LINE__) : qt_noop())
24
 
#define NOT_REACHED() qt_assert("Not reached!",__FILE__,__LINE__)
25
23
 
26
 
// Logging and assertion macros are compiled out for release builds.
27
 
#if !defined(QT_NO_DEBUG)
28
 
#define DLOG(...) LOG(__VA_ARGS__)
29
 
#define DLOG_IF(cond,...) LOG_IF((cond), __VA_ARGS__)
30
 
#define DASSERT(cond) ASSERT((cond))
31
 
#define DNOT_REACHED() NOT_REACHED()
32
 
#else
33
 
#define DLOG(...) qt_noop()
34
 
#define DLOG_IF(cond,...) qt_noop()
35
 
#define DASSERT(cond) qt_noop()
36
 
#define DNOT_REACHED() qt_noop()
37
 
#endif
 
24
Q_DECLARE_LOGGING_CATEGORY(ubuntumirclient)
 
25
Q_DECLARE_LOGGING_CATEGORY(ubuntumirclientBufferSwap)
 
26
Q_DECLARE_LOGGING_CATEGORY(ubuntumirclientInput)
38
27
 
39
28
#endif  // QUBUNTULOGGING_H