@@ -350,17 +350,21 @@ msgid ""
350350"attributes can then be used as you like. For example, they could be "
351351"incorporated into logged messages. For example::"
352352msgstr ""
353+ "第四个关键字参数是 *extra* ,传递一个字典,该字典用于填充为日志记录事件创建的、带有用户自定义属性的 :class:`LogRecord` "
354+ "中的__dict__ 。然后可以按照需求使用这些自定义属性。例如,可以将它们合并到已记录的消息中:"
353355
354356#: ../../library/logging.rst:212
355357msgid "would print something like"
356- msgstr ""
358+ msgstr "输出类似于 "
357359
358360#: ../../library/logging.rst:218 ../../library/logging.rst:997
359361msgid ""
360362"The keys in the dictionary passed in *extra* should not clash with the keys "
361363"used by the logging system. (See the :class:`Formatter` documentation for "
362364"more information on which keys are used by the logging system.)"
363365msgstr ""
366+ " *extra* 中传入的字典的键不应与日志系统使用的键冲突。(有关Formatter日志系统使用哪些键的更多信息,请参见 "
367+ ":class:`Formatter` 的文档。)"
364368
365369#: ../../library/logging.rst:222
366370msgid ""
@@ -372,6 +376,9 @@ msgid ""
372376"formatting exception will occur. So in this case, you always need to pass "
373377"the *extra* dictionary with these keys."
374378msgstr ""
379+ "如果在已记录的消息中使用这些属性,则需要格外小心。例如,在上面的示例中,:class:`Formatter` 已设置了格式字符串,其在 "
380+ ":class:`LogRecord` 的属性字典中键值为 “clientip” 和 "
381+ "“user”。如果缺少这些内容,则将不会记录该消息,因为会引发字符串格式化异常。因此,在这种情况下,您始终需要使用这些键传递 *extra* 字典。"
375382
376383#: ../../library/logging.rst:229 ../../library/logging.rst:1008
377384msgid ""
@@ -383,14 +390,16 @@ msgid ""
383390" likely that specialized :class:`Formatter`\\ s would be used with "
384391"particular :class:`Handler`\\ s."
385392msgstr ""
393+ "尽管这可能很烦人,但此功能旨在用于特殊情况,例如在多个上下文中执行相同代码的多线程服务器,并且出现的有趣条件取决于此上下文(例如在上面的示例中就是远程客户端IP地址和已验证用户名)。在这种情况下,很可能将专门的"
394+ " :class:`Formatter` 与特定的 :class:`Handler` 一起使用。"
386395
387396#: ../../library/logging.rst:236 ../../library/logging.rst:1015
388397msgid "The *stack_info* parameter was added."
389398msgstr "增加了 *stack_info* 参数。"
390399
391400#: ../../library/logging.rst:239
392401msgid "The *exc_info* parameter can now accept exception instances."
393- msgstr ""
402+ msgstr " *exc_info* 现在可以接受异常实例。 "
394403
395404#: ../../library/logging.rst:242
396405msgid "The *stacklevel* parameter was added."
@@ -400,53 +409,57 @@ msgstr "增加了 *stacklevel* 参数。"
400409msgid ""
401410"Logs a message with level :const:`INFO` on this logger. The arguments are "
402411"interpreted as for :meth:`debug`."
403- msgstr ""
412+ msgstr "在此记录器上记录 :const:`INFO` 级别的消息。参数解释同 :meth:`debug`。 "
404413
405414#: ../../library/logging.rst:254
406415msgid ""
407416"Logs a message with level :const:`WARNING` on this logger. The arguments are"
408417" interpreted as for :meth:`debug`."
409- msgstr ""
418+ msgstr "在此记录器上记录 :const:`WARNING` 级别的消息。参数解释同 :meth:`debug`。 "
410419
411420#: ../../library/logging.rst:257
412421msgid ""
413422"There is an obsolete method ``warn`` which is functionally identical to "
414423"``warning``. As ``warn`` is deprecated, please do not use it - use "
415424"``warning`` instead."
416425msgstr ""
426+ "有一个功能上与 ``warning`` 一致的方法 ``warn``。由于 ``warn`` 已被弃用,请不要使用它 —— 改为使用 "
427+ "``warning``。"
417428
418429#: ../../library/logging.rst:263
419430msgid ""
420431"Logs a message with level :const:`ERROR` on this logger. The arguments are "
421432"interpreted as for :meth:`debug`."
422- msgstr ""
433+ msgstr "在此记录器上记录 :const:`ERROR` 级别的消息。参数解释同 :meth:`debug`。 "
423434
424435#: ../../library/logging.rst:269
425436msgid ""
426437"Logs a message with level :const:`CRITICAL` on this logger. The arguments "
427438"are interpreted as for :meth:`debug`."
428- msgstr ""
439+ msgstr "在此记录器上记录 :const:`CRITICAL` 级别的消息。参数解释同 :meth:`debug`。 "
429440
430441#: ../../library/logging.rst:275
431442msgid ""
432443"Logs a message with integer level *level* on this logger. The other "
433444"arguments are interpreted as for :meth:`debug`."
434- msgstr ""
445+ msgstr "在此记录器上记录 *level* 整数代表的级别的消息。参数解释同 :meth:`debug`。 "
435446
436447#: ../../library/logging.rst:281
437448msgid ""
438449"Logs a message with level :const:`ERROR` on this logger. The arguments are "
439450"interpreted as for :meth:`debug`. Exception info is added to the logging "
440451"message. This method should only be called from an exception handler."
441452msgstr ""
453+ "在此记录器上记录 :const:`ERROR` 级别的消息。参数解释同 "
454+ ":meth:`debug`。异常信息将添加到日志消息中。仅应从异常处理程序中调用此方法。"
442455
443456#: ../../library/logging.rst:288
444457msgid "Adds the specified filter *filter* to this logger."
445- msgstr ""
458+ msgstr "将指定的过滤器 *filter* 添加到此记录器。 "
446459
447460#: ../../library/logging.rst:293
448461msgid "Removes the specified filter *filter* from this logger."
449- msgstr ""
462+ msgstr "从此记录器中删除指定的过滤器 *filter*。 "
450463
451464#: ../../library/logging.rst:298
452465msgid ""
@@ -456,14 +469,16 @@ msgid ""
456469" be processed (passed to handlers). If one returns a false value, no further"
457470" processing of the record occurs."
458471msgstr ""
472+ "将此记录器的过滤器应用于记录,如果记录能被处理则返回 "
473+ "``True``。过滤器会被依次使用,直到其中一个返回假值为止。如果它们都不返回假值,则记录将被处理(传递给处理器)。如果返回任一为假值,则不会对该记录做进一步处理。"
459474
460475#: ../../library/logging.rst:307
461476msgid "Adds the specified handler *hdlr* to this logger."
462- msgstr ""
477+ msgstr "将指定的处理器 *hdlr* 添加到此记录器。 "
463478
464479#: ../../library/logging.rst:312
465480msgid "Removes the specified handler *hdlr* from this logger."
466- msgstr ""
481+ msgstr "从此记录器中删除指定的处理器 *hdlr*。 "
467482
468483#: ../../library/logging.rst:317
469484msgid ""
0 commit comments