SEGS  0.6.1-develop [39915b3b]
Super Entity Game Server
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 - 2019 SEGS Team (see AUTHORS.md)
5  * This software is licensed under the terms of the 3-clause BSD License. See LICENSE.md 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 
24 SEGS_DECLARE_LOGGING_CATEGORY(logOrientation)
31 SEGS_DECLARE_LOGGING_CATEGORY(logPlayerSpawn)
35 SEGS_DECLARE_LOGGING_CATEGORY(logSlashCommand)
36 SEGS_DECLARE_LOGGING_CATEGORY(logDescription)
41 SEGS_DECLARE_LOGGING_CATEGORY(logAnimations)
46 SEGS_DECLARE_LOGGING_CATEGORY(logSceneGraph)
50 
51 void setLoggingFilter();
52 void toggleLogging(QString &category);
53 void dumpLogging();
54 #define TIMED_LOG(x,msg) {\
55  QDebug log(qDebug());\
56  log << msg << "..."; \
57  QElapsedTimer timer;\
58  timer.start();\
59  x;\
60  log << "done in"<<float(timer.elapsed())/1000.0f<<"s";\
61 }
void dumpLogging()
Definition: Logging.cpp:190
void toggleLogging(QString &category)
Definition: Logging.cpp:104
#define SEGS_DECLARE_LOGGING_CATEGORY(name)
Definition: Logging.h:13
void setLoggingFilter()
Definition: Logging.cpp:58