We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I found that SetLogger's severity is int.
severity
void base::SetLogger(LogSeverity severity, base::Logger* logger) { MutexLock l(&log_mutex); LogDestination::log_destination(severity)->logger_ = logger; }
but in log_destination severity must in [0, NUM_SEVERITIES]
inline LogDestination* LogDestination::log_destination(LogSeverity severity) { assert(severity >=0 && severity < NUM_SEVERITIES); if (!log_destinations_[severity]) { log_destinations_[severity] = new LogDestination(severity, NULL); } return log_destinations_[severity]; }
If you use an wrapped logger and set SetLogger's severity to -1, wrapped logger will not work, it seems use the default logger in glog then?
And I found that there are other restrictions in the code that cause severity should be greater or equal to 0. Why not set severity to unsigned type?
The text was updated successfully, but these errors were encountered:
Why would you want to set the severity to -1?
Sorry, something went wrong.
This maybe a bug, because you can't stop others from setting it up. I actually encountered!
With #1025 LogSeverity will become an enum which will prevent implicit conversions.
LogSeverity
Successfully merging a pull request may close this issue.
I found that SetLogger's
severity
is int.but in log_destination
severity
must in [0, NUM_SEVERITIES]If you use an wrapped logger and set SetLogger's
severity
to -1, wrapped logger will not work, it seems use the default logger in glog then?And I found that there are other restrictions in the code that cause
severity
should be greater or equal to 0. Why not setseverity
to unsigned type?The text was updated successfully, but these errors were encountered: