Classified ads
/tmp/classified-ads/classified_ads/log.h
Go to the documentation of this file.
1 /* -*-C++-*- -*-coding: utf-8-unix;-*-
2  Classified Ads is Copyright (c) Antti Järvinen 2013.
3 
4  This file is part of Classified Ads.
5 
6  Classified Ads is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) any later version.
10 
11  Classified Ads is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with Classified Ads; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 
21 #ifndef CLASSIFIED_ADS_LOG_H
22 #define CLASSIFIED_ADS_LOG_H
23 #include <stdio.h>
24 #include <QDateTime>
25 #ifdef DEBUG
26 #include <QDebug>
27 #define LOG_STR(a) qDebug() << QDateTime::currentDateTime().toString("hh:mm:ss") << a
28 #define LOG_STR2(a,b) { QString str ; qDebug() << QDateTime::currentDateTime().toString("hh:mm:ss") << str.sprintf(a,b) ; }
29 #define QLOG_STR(a) qDebug() << QDateTime::currentDateTime().toString("hh:mm:ss") << a
30 #else
31 #define LOG_STR(a)
32 #define LOG_STR2(a,b)
33 #define QLOG_STR(a)
34 #endif
35 #endif