Move logging defines to QMAKE instead of logging.h
Defines done outside of easylogging++.h does not work according to official documentation (https://github.com/zuhd-org/easyloggingpp/blob/master/README.md#configuration-macros) "NOTE: All the macros can be defined in one of the following ways: 1. Define macros using -D option of compiler, for example in case of g++ you will do g++ source.cpp ... -DELPP_SYSLOG -DELPP_THREAD_SAFE ... (recommended way) 2. Define macros inside "easylogging++.h" (defining macros in other files won't work)" Linking to this issue: https://github.com/zuhd-org/easyloggingpp/issues/590#issuecomment-346753951 We are using the developer recommended way of defining them by command line. What is assumed to be the intention of enabling debug logs before including easylogging++ never actually did anything, hence this define is dropped. Newer versions of easylogging++ uses the macro ELPP_DISABLE_DEBUG_LOGS to _disable_ debug logs. Leaving that macro undefined satisfies the original intent.
This commit is contained in:
+1
-13
@@ -1,16 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
// easylogging includes
|
||||
#ifndef _DEBUG
|
||||
# define _DEBUG
|
||||
# define ELPP_THREAD_SAFE
|
||||
# define ELPP_QT_LOGGING
|
||||
# define ELPP_NO_DEFAULT_LOG_FILE
|
||||
# include <easylogging++.h>
|
||||
# undef _DEBUG
|
||||
#else
|
||||
# define ELPP_THREAD_SAFE
|
||||
# define ELPP_QT_LOGGING
|
||||
# define ELPP_NO_DEFAULT_LOG_FILE
|
||||
# include <easylogging++.h>
|
||||
#endif
|
||||
#include <easylogging++.h>
|
||||
|
||||
Reference in New Issue
Block a user