MythTV master
Logging.h
Go to the documentation of this file.
1/* Logging.h
2
3 Copyright (C) David C. J. Matthews 2004 dm at prolingua.co.uk
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
18 Or, point your browser to http://www.gnu.org/copyleft/gpl.html
19
20*/
21
22#if !defined(LOGGING_H)
23#define LOGGING_H
24
25#include <QtGlobal> // For Q_ASSERT
26#include <QString> // For QString
27
28#include "freemheg.h" // For MHLogError
29
30#define MHASSERT(f) Q_ASSERT(f)
31
32extern int gMHLogoptions;
33extern void mhlog_fn(const QString& logtext);
34extern FILE *gMHLogStream;
35
36#define MHLOG(__level,__text) \
37do { \
38 if ((__level) & gMHLogoptions) \
39 mhlog_fn(__text); \
40} while (false)
41
42#define MHERROR(__text) \
43do { \
44 if (MHLogError & gMHLogoptions) \
45 mhlog_fn(__text); \
46 throw "Failed"; \
47} while (false)
48
49#endif
void mhlog_fn(const QString &logtext)
Definition: Engine.cpp:1528
int gMHLogoptions
Definition: Engine.cpp:1523
FILE * gMHLogStream
Definition: Engine.cpp:1525
int FILE
Definition: mythburn.py:138