edbee - Qt Editor Library
logging.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <QFileInfo>
9 #include <QsLog.h>
10 
11 
12 #define qlog_trace() \
13  if( QsLogging::Logger::instance().loggingLevel() > QsLogging::TraceLevel ){} \
14  else QsLogging::Logger::Helper(QsLogging::TraceLevel).stream() << QFileInfo(__FILE__).fileName() << '@' << __LINE__
15 #define qlog_debug() \
16  if( QsLogging::Logger::instance().loggingLevel() > QsLogging::DebugLevel ){} \
17  else QsLogging::Logger::Helper(QsLogging::DebugLevel).stream() << QFileInfo(__FILE__).fileName() << '@' << __LINE__
18 #define qlog_info() \
19  if( QsLogging::Logger::instance().loggingLevel() > QsLogging::InfoLevel ){} \
20  else QsLogging::Logger::Helper(QsLogging::InfoLevel).stream() << QFileInfo( __FILE__).fileName() << '@' << __LINE__
21 #define qlog_warn() \
22  if( QsLogging::Logger::instance().loggingLevel() > QsLogging::WarnLevel ){} \
23  else QsLogging::Logger::Helper(QsLogging::WarnLevel).stream() << QFileInfo(__FILE__).fileName() << '@' << __LINE__
24 #define qlog_error() \
25  if( QsLogging::Logger::instance().loggingLevel() > QsLogging::ErrorLevel ){} \
26  else QsLogging::Logger::Helper(QsLogging::ErrorLevel).stream() << QFileInfo(__FILE__).fileName() << '@' << __LINE__
27 #define qlog_fatal() \
28  QsLogging::Logger::Helper(QsLogging::FatalLevel).stream() << QFileInfo(__FILE__).fileName() << '@' << __LINE__
29 
30 
31 /*
32 #define qlog_trace() \
33  if( QsLogging::Logger::instance().loggingLevel() > QsLogging::TraceLevel ){} \
34  else QsLogging::Logger::Helper(QsLogging::TraceLevel).stream() << __FILE__ << '@' << __LINE__
35 #define qlog_debug() \
36  if( QsLogging::Logger::instance().loggingLevel() > QsLogging::DebugLevel ){} \
37  else QsLogging::Logger::Helper(QsLogging::DebugLevel).stream() << __FILE__ << '@' << __LINE__
38 #define qlog_info() \
39  if( QsLogging::Logger::instance().loggingLevel() > QsLogging::InfoLevel ){} \
40  else QsLogging::Logger::Helper(QsLogging::InfoLevel).stream() << __FILE__ << '@' << __LINE__
41 #define qlog_warn() \
42  if( QsLogging::Logger::instance().loggingLevel() > QsLogging::WarnLevel ){} \
43  else QsLogging::Logger::Helper(QsLogging::WarnLevel).stream() << __FILE__ << '@' << __LINE__
44 #define qlog_error() \
45  if( QsLogging::Logger::instance().loggingLevel() > QsLogging::ErrorLevel ){} \
46  else QsLogging::Logger::Helper(QsLogging::ErrorLevel).stream() << __FILE__ << '@' << __LINE__
47 #define qlog_fatal() \
48  QsLogging::Logger::Helper(QsLogging::FatalLevel).stream() << __FILE__ << '@' << __LINE__
49 */
50 
51 
52 #define qlog() \
53  QsLogging::Logger::Helper(QsLogging::InfoLevel).stream()
54 
55