What is Python's default logging formatter?

后端 未结 5 1613
有刺的猬
有刺的猬 2021-02-05 01:02

I\'m trying to decipher the information contained in my logs (the logging setup is using the default formatter). The documentation states:

Do formatting f

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-05 01:47

    It's in the source of logging/__init__.py:

    _defaultFormatter = Formatter()
    

    The default formatting string is %(message)s, which is in the source as well:

    if fmt:
        self._fmt = fmt
    else:
        self._fmt = "%(message)s"
    

提交回复
热议问题