Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dbd6ae6

Browse files
[po] auto sync
1 parent 739505a commit dbd6ae6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

howto/logging-cookbook.po

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,11 @@ msgid ""
660660
" logging calls which are out there in existing code will be using %-format "
661661
"strings."
662662
msgstr ""
663+
"日志调用(``logger.debug()`` 、``logger.info()`` "
664+
"等)接受的位置参数只会用于日志信息本身,而关键字参数仅用于日志调用的可选处理参数(如关键字参数 ``exc_info`` 表示应记录跟踪信息, "
665+
"``extra`` 则标识了需要加入日志的额外上下文信息)。所以不能直接用 :meth:`str.format` 或 "
666+
":class:`string.Template` 语法进行日志调用,因为日志包在内部使用 %-f "
667+
"格式来合并格式串和参数变量。在保持向下兼容性时,这一点不会改变,因为已有代码中的所有日志调用都会使用%-f 格式串。"
663668

664669
#: ../../howto/logging-cookbook.rst:1111
665670
msgid ""
@@ -669,6 +674,8 @@ msgid ""
669674
"will call ``str()`` on that object to get the actual format string. Consider"
670675
" the following two classes::"
671676
msgstr ""
677+
"还有一种方法可以构建自己的日志信息,就是利用 {}- 和 $- 格式。回想一下,任意对象都可用为日志信息的格式串,日志包将会调用该对象的 "
678+
"``str()`` 方法,以获取最终的格式串。不妨看下一下两个类:"
672679

673680
#: ../../howto/logging-cookbook.rst:1135
674681
msgid ""

0 commit comments

Comments
 (0)