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

Lever not assigned in Writer via custom LogMessage #666

Closed
abumq opened this issue Sep 6, 2018 · 0 comments
Closed

Lever not assigned in Writer via custom LogMessage #666

abumq opened this issue Sep 6, 2018 · 0 comments

Comments

@abumq
Copy link
Owner

abumq commented Sep 6, 2018

This issue was originally noticed in residue logging server. Code here

Basically, in Writer construction with custom LogMessage, m_level is not assigned, as a result level's enabled/disabled state is dependent upon undefined behaviour.

Writer(LogMessage* msg, base::DispatchAction dispatchAction = base::DispatchAction::NormalLog) :
    m_msg(msg), m_line(0), m_logger(nullptr), m_proceed(false), m_dispatchAction(dispatchAction) {
  }

This is ignored as a result of this

m_proceed = m_logger->enabled(m_level) 

We need to assign anything that is available in msg as long as they're valid values, especially m_level as it's checked at construct

@abumq abumq mentioned this issue Sep 6, 2018
@abumq abumq closed this as completed in 680aeec Sep 6, 2018
weaselp pushed a commit to weaselp/easyloggingpp that referenced this issue Dec 3, 2019
* upstream/master:
  update
  Create FUNDING.yml
  updated build matrix links
  Update README.md
  Update README.md
  9.96.7 release
  updated release
  updated license
  generate PIC code for the library
  Fixed unused variable warning while build without performance logging feature
  Fix abumq#660 (accessing ELPP before it's initialized)
  Simplify some code based on already checked values
  release
  up
  removed message
  Ignore sigint
  Fixes abumq#666 Set log level from custom message if available
  Add Emscripten detection, with test modifications
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant