Uploaded image for project: 'Request For Comments'
  1. Request For Comments
  2. RFC-265

Support Python string formatting method in logging

    Details

    • Type: RFC
    • Status: Implemented
    • Resolution: Done
    • Component/s: DM
    • Labels:
      None
    • Location:
      on this ticket

      Description

      Python has two (3 in python 3.6) ways of formatting a string for output. The log package currently assumes that %-style formatting is being used for all log output but in some cases it is more convenient to use the format method style instead.

      The proposal is that we add new logging methods, for example debugf and infof, that assume format-method formatting. This formatting will be applied internally at the python layer if the log message is to be written as is done now for %-style formatting.

      We have discounted a "magic" approach of checking the logging string for curly braces or percent symbols. We have also discounted migrating the entire stack to use format for logging as python seems perfectly happy to have 2 (3) styles itself.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tjenness Tim Jenness
                Reporter:
                tjenness Tim Jenness
                Watchers:
                Andy Salnikov, Hsin-Fang Chiang, Jim Bosch, John Parejko, John Swinbank, Kian-Tat Lim, Mario Juric, Tim Jenness
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Planned End:

                  Summary Panel