1-arg shouldLog violates One Definition Rule

XMLWordPrintableJSON

    • Fully Compatible
    • ALL
    • Security 2021-03-22
    • 2
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      [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

       

              Assignee:
              Billy Donahue
              Reporter:
              Billy Donahue
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: