SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Logging.h
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2018 SEGS Team (see Authors.txt)
5  * This software is licensed! (See License.txt for details)
6  */
7 
8 #pragma once
9 #include <QtCore/QLoggingCategory>
10 #include <QElapsedTimer>
11 
12 // Declare common logging categories
13 #define SEGS_DECLARE_LOGGING_CATEGORY(name) \
14  extern QLoggingCategory &name();
15 
23 SEGS_DECLARE_LOGGING_CATEGORY(logOrientation)
30 SEGS_DECLARE_LOGGING_CATEGORY(logSlashCommand)
31 SEGS_DECLARE_LOGGING_CATEGORY(logDescription)
35 
36 void setLoggingFilter();
37 void toggleLogging(QString &category);
38 void dumpLogging();
39 #define TIMED_LOG(x,msg) {\
40  QDebug log(qDebug());\
41  log << msg << "..."; \
42  QElapsedTimer timer;\
43  timer.start();\
44  x;\
45  log << "done in"<<float(timer.elapsed())/1000.0f<<"s";\
46 }
void dumpLogging()
Definition: Logging.cpp:131
void toggleLogging(QString &category)
Definition: Logging.cpp:75
#define SEGS_DECLARE_LOGGING_CATEGORY(name)
Definition: Logging.h:13
void setLoggingFilter()
Definition: Logging.cpp:43