-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Internal Code
-
Fully Compatible
-
ALL
-
Security 2021-03-22
-
2
[subtask of SERVER-52604]
mongo::shouldLog(component, severity) is fine.
mongo::shouldLog(severity) fills in the default component by referring to a variable in the anonymous namespace. So a program will have multiple mongo::shouldLog(severity) definitions, all referring to completely different component variables. This is a violation of the One Definition Rule.
Can be easily fixed, just remove the 1-arg shouldLog function. Replace all callers (7 or so) with shouldLog(MONGO_LOGV2_DEFAULT_COMPONENT, severity)
https://github.com/mongodb/mongo/commit/955af4ef6fa94b76a24faa810435181b5ee3e140
- is depended on by
-
SERVER-52604 Log from anywhere (normalize MONGO_LOGV2_DEFAULT_COMPONENT)
- Closed