Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-100967

Investigate if we could/should change print() default format

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      print() is a mongo shell function implemented in C++ that currently prints all its serialized arguments joint by a space. Internally, print() uses LOGV2 logging API in a 'plain' mode. Optionally, we could switch between the 'plain' and 'json' mode of LOGV2 output depending on the value of the global TestData.logFormat property similar to what we did in SERVER-100041 for the uncaught exceptions.

      Our test logging function jsTest.log.info(), jsTest.log.debug(), etc. currently use print() to output the result imitating the LOGV2 format, however, should print() switch to the JSON output, we will need an alternative function printLog(severity, msg, attr) to be called from jsTest.log.info(), jsTest.log.debug(), etc.

            Assignee:
            romans.kasperovics@mongodb.com Romans Kasperovics
            Reporter:
            romans.kasperovics@mongodb.com Romans Kasperovics
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              None
              None
              None
              None