-
-
Notifications
You must be signed in to change notification settings - Fork 918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to disable default log #590
Comments
Define the macro ELPP_NO_DEFAULT_LOG_FILE using -D option of compiler, for example in case of g++ you need do |
@chrisniael , how should I define this macro in Visual Studio?
|
To set this compiler option in the Visual Studio development environment
Refer to Microsoft's reference document /D (Preprocessor Definitions) |
@chrisniael , thanks, it works specifying |
@rdiachenko I assume your code file name is main.cpp, where define the macro
when the compiler build your project, it has many steps. one of these steps is to compile easylogging++.cpp and main.cpp to their object files separately (easylogging++.o and main.o), when compiling easylogging++.cpp, the compiler don't find the macro define |
@chrisniael thanks for explanation, it makes things clear for now. Looks like it does make sense to add your note to README |
@rdiachenko You're welcome : ) |
@chrisniael Thanks for your explanation |
I suppose this issue can be closed. The pull request with clarifications for macros configuration was applied - #597 |
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: abumq/easyloggingpp#590 (comment) 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.
Update logging dependency from 9.84 to 9.89 This is the newest version that doesn't lead to compile errors. It has also reduced the amount of "-Wexpansion-to-defined" errors on clang-msvc by about 80 (from ~400 to 320). Update easylogging license file Originally came as LICENCE.txt (notice C instead of S in LICENSE), renamed to better fit into the git history. 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: abumq/easyloggingpp#590 (comment) 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. Move easylogging++ include into necessary files logging.h previously had logic to enable debug logging even on release builds. This logic was moved to the QMAKE file, hence the logging.h file is no longer necessary. Update easylogging++ to 9.96.7, turn on /WX for clang-msvc Updating from easylogging++ 9.89 to 9.96.7 turns it from a header only library to one requiring a source file. It has been added to sources near the other third party includes in the QMAKE to signify that it isn't a first party file. Updating easylogging++ also means that clang-msvc can compile without any warnings, hence turning on warnings as errors for that compiler as well, to avoid any regressions. updated to current fixed formatting fixed ptt add bug/compilerwarnings/c++14 target cleaned up .pro file fixed casting back to c++ style added default profile and ptt profile view
Update logging dependency from 9.84 to 9.89 This is the newest version that doesn't lead to compile errors. It has also reduced the amount of "-Wexpansion-to-defined" errors on clang-msvc by about 80 (from ~400 to 320). Update easylogging license file Originally came as LICENCE.txt (notice C instead of S in LICENSE), renamed to better fit into the git history. 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: abumq/easyloggingpp#590 (comment) 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. Move easylogging++ include into necessary files logging.h previously had logic to enable debug logging even on release builds. This logic was moved to the QMAKE file, hence the logging.h file is no longer necessary. Update easylogging++ to 9.96.7, turn on /WX for clang-msvc Updating from easylogging++ 9.89 to 9.96.7 turns it from a header only library to one requiring a source file. It has been added to sources near the other third party includes in the QMAKE to signify that it isn't a first party file. Updating easylogging++ also means that clang-msvc can compile without any warnings, hence turning on warnings as errors for that compiler as well, to avoid any regressions. updated to current fixed formatting fixed ptt add bug/compilerwarnings/c++14 target cleaned up .pro file fixed casting back to c++ style added default profile and ptt profile view
Update logging dependency from 9.84 to 9.89 This is the newest version that doesn't lead to compile errors. It has also reduced the amount of "-Wexpansion-to-defined" errors on clang-msvc by about 80 (from ~400 to 320). Update easylogging license file Originally came as LICENCE.txt (notice C instead of S in LICENSE), renamed to better fit into the git history. 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: abumq/easyloggingpp#590 (comment) 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. Move easylogging++ include into necessary files logging.h previously had logic to enable debug logging even on release builds. This logic was moved to the QMAKE file, hence the logging.h file is no longer necessary. Update easylogging++ to 9.96.7, turn on /WX for clang-msvc Updating from easylogging++ 9.89 to 9.96.7 turns it from a header only library to one requiring a source file. It has been added to sources near the other third party includes in the QMAKE to signify that it isn't a first party file. Updating easylogging++ also means that clang-msvc can compile without any warnings, hence turning on warnings as errors for that compiler as well, to avoid any regressions. updated to current fixed formatting fixed ptt add bug/compilerwarnings/c++14 target cleaned up .pro file fixed casting back to c++ style added default profile and ptt profile view fixed c++ casts fixed logic error on getDevice functions
See , I am using configfromglobal function and I don't want myeasylog.log file to be created. I tried disabling the macro for default log but still myeasylog.log is being made
The text was updated successfully, but these errors were encountered: