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

Recursive calls to glog do not correctly handle "group" and "verbosity" settings #32

Open
tsaubergine opened this issue May 15, 2018 · 0 comments

Comments

@tsaubergine
Copy link
Member

tsaubergine commented May 15, 2018

We need a stack to handle the current group and verbosity settings when glog is called recursively, e.g.

void write()
{
  glog.is(DEBUG1) && glog << group("bar") << "testing" << std::endl;
}

int main()
{
   glog.is(DEBUG2) && glog << group("foo") << write() << std::endl;
}

In this case, the embedded call to write() calls glog again and when it is flushed (std::endl), the group and verbosity are erased. This means that in the case of multithreaded use, the logger mutex is never released, and other threads will wait forever on locking the mutex.

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

No branches or pull requests

1 participant