Expand Up @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-31 00:21 +0000\n" "POT-Creation-Date: 2022-09-04 00:18 +0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" Expand Down Expand Up @@ -1428,7 +1428,7 @@ msgid "" msgstr "" #: ../../library/logging.handlers.rst:1034 #: ../../library/logging.handlers.rst:1109 #: ../../library/logging.handlers.rst:1123 msgid "" "If you are using :mod:`multiprocessing`, you should avoid using :class:" "`~queue.SimpleQueue` and instead use :class:`multiprocessing.Queue`." Expand Down Expand Up @@ -1467,25 +1467,41 @@ msgid "" "the original intact." msgstr "" #: ../../library/logging.handlers.rst:1065 #: ../../library/logging.handlers.rst:1063 msgid "" "The base implementation formats the message with arguments, sets the " "``message`` and ``msg`` attributes to the formatted message and sets the " "``args`` and ``exc_text`` attributes to ``None`` to allow pickling and to " "prevent further attempts at formatting. This means that a handler on the :" "class:`QueueListener` side won't have the information to do custom " "formatting, e.g. of exceptions. You may wish to subclass ``QueueHandler`` " "and override this method to e.g. avoid setting ``exc_text`` to ``None``. " "Note that the ``message`` / ``msg`` / ``args`` changes are related to " "ensuring the record is pickleable, and you might or might not be able to " "avoid doing that depending on whether your ``args`` are pickleable. (Note " "that you may have to consider not only your own code but also code in any " "libraries that you use.)" msgstr "" #: ../../library/logging.handlers.rst:1079 msgid "" "Enqueues the record on the queue using ``put_nowait()``; you may want to " "override this if you want to use blocking behaviour, or a timeout, or a " "customized queue implementation." msgstr "" #: ../../library/logging.handlers.rst:1071 #: ../../library/logging.handlers.rst:1085 msgid "" "When created via configuration using :func:`~logging.config.dictConfig`, " "this attribute will contain a :class:`QueueListener` instance for use with " "this handler. Otherwise, it will be ``None``." msgstr "" #: ../../library/logging.handlers.rst:1080 #: ../../library/logging.handlers.rst:1094 msgid "QueueListener" msgstr "QueueListener" #: ../../library/logging.handlers.rst:1084 #: ../../library/logging.handlers.rst:1098 msgid "" "The :class:`QueueListener` class, located in the :mod:`logging.handlers` " "module, supports receiving logging messages from a queue, such as those " Expand All @@ -1496,7 +1512,7 @@ msgid "" "works hand-in-hand with :class:`QueueHandler`." msgstr "" #: ../../library/logging.handlers.rst:1092 #: ../../library/logging.handlers.rst:1106 msgid "" "Along with the :class:`QueueHandler` class, :class:`QueueListener` can be " "used to let handlers do their work on a separate thread from the one which " Expand All @@ -1506,7 +1522,7 @@ msgid "" "an email via :class:`SMTPHandler`) are done on a separate thread." msgstr "" #: ../../library/logging.handlers.rst:1101 #: ../../library/logging.handlers.rst:1115 msgid "" "Returns a new instance of the :class:`QueueListener` class. The instance is " "initialized with the queue to send messages to and a list of handlers which " Expand All @@ -1517,90 +1533,90 @@ msgid "" "class:`~queue.SimpleQueue` instances for *queue*." msgstr "" #: ../../library/logging.handlers.rst:1112 #: ../../library/logging.handlers.rst:1126 msgid "" "If ``respect_handler_level`` is ``True``, a handler's level is respected " "(compared with the level for the message) when deciding whether to pass " "messages to that handler; otherwise, the behaviour is as in previous Python " "versions - to always pass each message to each handler." msgstr "" #: ../../library/logging.handlers.rst:1117 #: ../../library/logging.handlers.rst:1131 msgid "The ``respect_handler_level`` argument was added." msgstr "新增 ``respect_handler_level`` 引數。" #: ../../library/logging.handlers.rst:1122 #: ../../library/logging.handlers.rst:1136 msgid "Dequeues a record and return it, optionally blocking." msgstr "" #: ../../library/logging.handlers.rst:1124 #: ../../library/logging.handlers.rst:1138 msgid "" "The base implementation uses ``get()``. You may want to override this method " "if you want to use timeouts or work with custom queue implementations." msgstr "" #: ../../library/logging.handlers.rst:1130 #: ../../library/logging.handlers.rst:1144 msgid "Prepare a record for handling." msgstr "" #: ../../library/logging.handlers.rst:1132 #: ../../library/logging.handlers.rst:1146 msgid "" "This implementation just returns the passed-in record. You may want to " "override this method if you need to do any custom marshalling or " "manipulation of the record before passing it to the handlers." msgstr "" #: ../../library/logging.handlers.rst:1138 #: ../../library/logging.handlers.rst:1152 msgid "Handle a record." msgstr "" #: ../../library/logging.handlers.rst:1140 #: ../../library/logging.handlers.rst:1154 msgid "" "This just loops through the handlers offering them the record to handle. The " "actual object passed to the handlers is that which is returned from :meth:" "`prepare`." msgstr "" #: ../../library/logging.handlers.rst:1146 #: ../../library/logging.handlers.rst:1160 msgid "Starts the listener." msgstr "" #: ../../library/logging.handlers.rst:1148 #: ../../library/logging.handlers.rst:1162 msgid "" "This starts up a background thread to monitor the queue for LogRecords to " "process." msgstr "" #: ../../library/logging.handlers.rst:1153 #: ../../library/logging.handlers.rst:1167 msgid "Stops the listener." msgstr "" #: ../../library/logging.handlers.rst:1155 #: ../../library/logging.handlers.rst:1169 msgid "" "This asks the thread to terminate, and then waits for it to do so. Note that " "if you don't call this before your application exits, there may be some " "records still left on the queue, which won't be processed." msgstr "" #: ../../library/logging.handlers.rst:1161 #: ../../library/logging.handlers.rst:1175 msgid "" "Writes a sentinel to the queue to tell the listener to quit. This " "implementation uses ``put_nowait()``. You may want to override this method " "if you want to use timeouts or work with custom queue implementations." msgstr "" #: ../../library/logging.handlers.rst:1172 #: ../../library/logging.handlers.rst:1186 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" #: ../../library/logging.handlers.rst:1172 #: ../../library/logging.handlers.rst:1186 msgid "API reference for the logging module." msgstr "" #: ../../library/logging.handlers.rst:1174 #: ../../library/logging.handlers.rst:1188 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" #: ../../library/logging.handlers.rst:1175 #: ../../library/logging.handlers.rst:1189 msgid "Configuration API for the logging module." msgstr ""