Add styleguide section in logv2/README.md

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.3.4
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Dev Tools 2020-02-10
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      From Bruce:

      For example, maybe something like:

      • "msg" fields (the simple variety) should be pithy noun phrase or sentence describing what is being reported. Initial capital, ending with period .
      • attributes should be a small number of camel-case words succinctly describing the relationship of the attribute to what is being reported in a way that's understandable to someone with a reasonable knowledge of mongod behavior as viewed externally. These would be similar to C++ identifiers, except that unlike C++ identifiers they shouldn't depend on surrounding code context to understand. Depending on "msg" content to understand is ok. Maybe method names in an interface would be a better comparison than variable names?
      • Simple fixed string messages with no additional information needed should be contained in the "msg" field with no attributes. (This is prompted be a counter-example I saw in a log file that looked something like "msg": "{message}", "attr": {"message": "actual message for real now"}. I felt my eyes beginning to bleed. )

            Assignee:
            Henrik Edin
            Reporter:
            Henrik Edin
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: