Skip to content
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

Disable log file *initially* when using ELPP_NO_LOG_TO_FILE, to be consistent with documentation #561

Closed
wants to merge 1 commit into from

Conversation

rggjan
Copy link

@rggjan rggjan commented Aug 16, 2017

Currently, setting "ELPP_NO_LOG_TO_FILE" disables logging to file entirely. However, the documentation says it is only disabled initially.

When applying the current pull request, it is possible to disable it initially and set a custom log file location at runtime like this:

#define ELPP_NO_LOG_TO_FILE
#define ELPP_NO_DEFAULT_LOG_FILE

#include <easylogging++.h>

INITIALIZE_EASYLOGGINGPP

int main(int, char **) {
  el::Loggers::reconfigureAllLoggers(el::ConfigurationType::Filename,
                                     "test.log");
  el::Loggers::reconfigureAllLoggers(el::ConfigurationType::ToFile, "true");

  LOG(INFO) << "Test";
}

This is impossible with the current implementation.

This is a

  • Breaking change
  • New feature
  • [ x] Bugfix

…nsistent with documentation

Currently, setting "ELPP_NO_LOG_TO_FILE" disables logging to file entirely. However, the documentation says it is only disabled initially.

When applying the current pull request, it is possible to disable it initially and set a custom log file location at runtime like this:

#define ELPP_NO_LOG_TO_FILE
#define ELPP_NO_DEFAULT_LOG_FILE

#include <easylogging++.h>

INITIALIZE_EASYLOGGINGPP

int main(int, char **) {
  el::Loggers::reconfigureAllLoggers(el::ConfigurationType::Filename,
                                     "test.log");
  el::Loggers::reconfigureAllLoggers(el::ConfigurationType::ToFile, "true");

  LOG(INFO) << "Test";
}

This is impossible with the current implementation.
@abumq
Copy link
Owner

abumq commented Oct 7, 2017

Please make all the changes to develop branch

@abumq
Copy link
Owner

abumq commented Feb 14, 2018

I have applied this change manually in fb67e3a

@abumq abumq closed this Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants