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 
32 extern int __mhlogoptions;
33 extern void __mhlog(const QString& logtext);
34 extern FILE *__mhlogStream;
35 
36 #define MHLOG(__level,__text) \
37 do { \
38  if (__level & __mhlogoptions) \
39  __mhlog(__text); \
40 } while (false)
41 
42 #define MHERROR(__text) \
43 do { \
44  if (MHLogError & __mhlogoptions) \
45  __mhlog(__text); \
46  throw "Failed"; \
47 } while (false)
48 
49 #endif
void __mhlog(const QString &logtext)
Definition: Engine.cpp:1481
FILE * __mhlogStream
Definition: Engine.cpp:1478
int FILE
Definition: mythburn.py:110
int __mhlogoptions
Definition: Engine.cpp:1476