8000 sync with cpython 88a1e6db · python/python-docs-zh-tw@f7c4f23 · GitHub
[go: up one dir, main page]

Skip to content
< 8000 header class="HeaderMktg header-logged-out js-details-container js-header Details f4 py-3" role="banner" data-is-top="true" data-color-mode=light data-light-theme=light data-dark-theme=dark>

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f7c4f23

Browse files
github-actions[bot]mattwang44
authored andcommitted
sync with cpython 88a1e6db
1 parent f0182a3 commit f7c4f23

File tree

1 file changed

+78
-37
lines changed

1 file changed

+78
-37
lines changed

library/logging.config.po

Lines changed: 78 additions & 37 deletions
+
"dictionary."
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: Python 3.11\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2022-10-15 20:43+0000\n"
10+
"POT-Creation-Date: 2023-01-28 00:15+0000\n"
1111
"PO-Revision-Date: 2018-05-23 16:05+0000\n"
1212
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
1313
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -664,37 +664,78 @@ msgstr ""
664664

665665
#: ../../library/logging.config.rst:528
666666
msgid ""
667+
"The values for keys such as ``bar``, ``spam`` and ``answer`` in the above "
668+
"example should not be configuration dictionaries or references such as "
669+
"``cfg://foo`` or ``ext://bar``, because they will not be processed by the "
670+
"configuration machinery, but passed to the callable as-is."
671+
msgstr ""
672+
673+
#: ../../library/logging.config.rst:533
674+
msgid ""
667675
"The key ``'()'`` has been used as the special key because it is not a valid "
668676
"keyword parameter name, and so will not clash with the names of the keyword "
669677
"arguments used in the call. The ``'()'`` also serves as a mnemonic that the "
670678
"corresponding value is a callable."
671679
msgstr ""
672680

673-
#: ../../library/logging.config.rst:533
681+
#: ../../library/logging.config.rst:538
674682
msgid ""
675683
"The ``filters`` member of ``handlers`` and ``loggers`` can take filter "
676684
"instances in addition to ids."
677685
msgstr ""
678686

679-
#: ../../library/logging.config.rst:537
687+
#: ../../library/logging.config.rst:542
680688
msgid ""
681689
"You can also specify a special key ``'.'`` whose value is a dictionary is a "
682690
"mapping of attribute names to values. If found, the specified attributes "
683691
"will be set on the user-defined object before it is returned. Thus, with the "
684692
"following configuration::"
685693
msgstr ""
686694

687-
#: ../../library/logging.config.rst:553
695+
#: ../../library/logging.config.rst:558
688696
msgid ""
689697
"the returned formatter will have attribute ``foo`` set to ``'bar'`` and "
690698
"attribute ``baz`` set to ``'bozz'``."
691699
msgstr ""
692700

693-
#: ../../library/logging.config.rst:560
701+
#: ../../library/logging.config.rst:561
702+
msgid ""
703+
"The values for attributes such as ``foo`` and ``baz`` in the above example "
704+
"should not be configuration dictionaries or references such as ``cfg://foo`` "
705+
"or ``ext://bar``, because they will not be processed by the configuration "
706+
"machinery, but set as attribute values as-is."
707+
msgstr ""
708+
709+
#: ../../library/logging.config.rst:570
710+
msgid "Handler configuration order"
711+
msgstr ""
712+
713+
#: ../../library/logging.config.rst:572
714+
msgid ""
715+
"Handlers are configured in alphabetical order of their keys, and a "
716+
"configured handler replaces the configuration dictionary in (a working copy "
717+
"of) the ``handlers`` dictionary in the schema. If you use a construct such "
718+
"as ``cfg://handlers.foo``, then initially ``handlers['foo']`` points to the "
719+
"configuration dictionary for the handler named ``foo``, and later (once that "
720+
"handler has been configured) it points to the configured handler instance. "
721+
"Thus, ``cfg://handlers.foo`` could resolve to either a dictionary or a "
722+
"handler instance. In general, it is wise to name handlers in a way such that "
723+
"dependent handlers are configured _after_ any handlers they depend on; that "
724+
"allows something like ``cfg://handlers.foo`` to be used in configuring a "
725+
"handler that depends on handler ``foo``. If that dependent handler were "
726+
"named ``bar``, problems would result, because the configuration of ``bar`` "
727+
"would be attempted before that of ``foo``, and ``foo`` would not yet have "
728+
"been configured. However, if the dependent handler were named ``foobar``, it "
729+
"would be configured after ``foo``, with the result that ``cfg://handlers."
730+
"foo`` would resolve to configured handler ``foo``, and not its configuration "
731
732+
msgstr ""
733+
734+
#: ../../library/logging.config.rst:593
694735
msgid "Access to external objects"
695736
msgstr ""
696737

697-
#: ../../library/logging.config.rst:562
738+
#: ../../library/logging.config.rst:595
698739
msgid ""
699740
"There are times where a configuration needs to refer to objects external to "
700741
"the configuration, for example ``sys.stderr``. If the configuration dict is "
@@ -709,7 +750,7 @@ msgid ""
709750
"import mechanisms."
710751
msgstr ""
711752

712-
#: ../../library/logging.config.rst:575
753+
#: ../../library/logging.config.rst:608
713754
msgid ""
714755
"The handling of such prefixes is done in a way analogous to protocol "
715756
"handling: there is a generic mechanism to look for prefixes which match the "
@@ -719,11 +760,11 @@ msgid ""
719760
"prefix is not recognised, then the string value will be left as-is."
720761
msgstr ""
721762

722-
#: ../../library/logging.config.rst:587
763+
#: ../../library/logging.config.rst:620
723764
msgid "Access to internal objects"
724765
msgstr ""
725766

726-
#: ../../library/logging.config.rst:589
767+
#: ../../library/logging.config.rst:622
727768
msgid ""
728769
"As well as external objects, there is sometimes also a need to refer to "
729770
"objects in the configuration. This will be done implicitly by the "
@@ -734,7 +775,7 @@ msgid ""
734775
"and resolve to the appropriate destination object."
735776
msgstr ""
736777

737-
#: ../../library/logging.config.rst:597
778+
#: ../../library/logging.config.rst:630
738779
msgid ""
739780
"However, a more generic mechanism is needed for user-defined objects which "
740781
"are not known to the :mod:`logging` module. For example, consider :class:"
@@ -748,7 +789,7 @@ msgid ""
748789
"resolution system allows the user to specify:"
749790
msgstr ""
750791

751-
#: ../../library/logging.config.rst:619
792+
#: ../../library/logging.config.rst:652
752793
msgid ""
753794
"The literal string ``'cfg://handlers.file'`` will be resolved in an "
754795
"analogous way to strings with the ``ext://`` prefix, but looking in the "
@@ -757,7 +798,7 @@ msgid ""
757798
"format``. Thus, given the following snippet:"
758799
msgstr ""
759800

760-
#: ../../library/logging.config.rst:637
801+
#: ../../library/logging.config.rst:670
761802
msgid ""
762803
"in the configuration, the string ``'cfg://handlers'`` would resolve to the "
763804
"dict with key ``handlers``, the string ``'cfg://handlers.email`` would "
@@ -773,7 +814,7 @@ msgid ""
773814
"to the string value if needed."
774815
msgstr ""
775816

776-
#: ../../library/logging.config.rst:651
817+
#: ../../library/logging.config.rst:684
777818
msgid ""
778819
"Given a string ``cfg://handlers.myhandler.mykey.123``, this will resolve to "
779820
"``config_dict['handlers']['myhandler']['mykey']['123']``. If the string is "
@@ -783,11 +824,11 @@ msgid ""
783824
"['mykey']['123']`` if that fails."
784825
msgstr ""
785826

786-
#: ../../library/logging.config.rst:663
827+
#: ../../library/logging.config.rst:696
787828
msgid "Import resolution and custom importers"
788829
msgstr ""
789830

790-
#: ../../library/logging.config.rst:665
831+
#: ../../library/logging.config.rst:698
791832
msgid ""
792833
"Import resolution, by default, uses the builtin :func:`__import__` function "
793834
"to do its importing. You may want to replace this with your own importing "
@@ -799,17 +840,17 @@ msgid ""
799840
"instance level, you need to wrap it with :func:`staticmethod`. For example::"
800841
msgstr ""
801842

802-
#: ../../library/logging.config.rst:680
843+
#: ../../library/logging.config.rst:713
803844
msgid ""
804845
"You don't need to wrap with :func:`staticmethod` if you're setting the "
805846
"import callable on a configurator *instance*."
806847
msgstr ""
807848

808-
#: ../../library/logging.config.rst:687
849+
#: ../../library/logging.config.rst:720
809850
msgid "Configuration file format"
810851
msgstr ""
811852

812-
#: ../../library/logging.config.rst:689
853+
#: ../../library/logging.config.rst:722
813854
msgid ""
814855
"The configuration file format understood by :func:`fileConfig` is based on :"
815856
"mod:`configparser` functionality. The file must contain sections called "
@@ -826,7 +867,7 @@ msgid ""
826867
"specified in a section called ``[logger_root]``."
827868
msgstr ""
828869

829-
#: ../../library/logging.config.rst:704
870+
#: ../../library/logging.config.rst:737
830871
msgid ""
831872
"The :func:`fileConfig` API is older than the :func:`dictConfig` API and does "
832873
"not provide functionality to cover certain aspects of logging. For example, "
@@ -839,39 +880,39 @@ msgid ""
839880
"when it's convenient to do so."
840881
msgstr ""
841882

842-
#: ../../library/logging.config.rst:714
883+
#: ../../library/logging.config.rst:747
843884
msgid "Examples of these sections in the file are given below."
844885
msgstr ""
845886

846-
#: ../../library/logging.config.rst:727
887+
#: ../../library/logging.config.rst:760
847888
msgid ""
848889
"The root logger must specify a level and a list of handlers. An example of a "
849890
"root logger section is given below."
850891
msgstr ""
851892

852-
#: ../../library/logging.config.rst:736
893+
#: ../../library/logging.config.rst:769
853894
msgid ""
854895
"The ``level`` entry can be one of ``DEBUG, INFO, WARNING, ERROR, CRITICAL`` "
855896
"or ``NOTSET``. For the root logger only, ``NOTSET`` means that all messages "
856897
"will be logged. Level values are :ref:`evaluated <func-eval>` in the context "
857898
"of the ``logging`` package's namespace."
858899
msgstr ""
859900

860-
#: ../../library/logging.config.rst:741
901+
#: ../../library/logging.config.rst:774
861902
msgid ""
862903
"The ``handlers`` entry is a comma-separated list of handler names, which "
863904
"must appear in the ``[handlers]`` section. These names must appear in the "
864905
"``[handlers]`` section and have corresponding sections in the configuration "
865906
"file."
866907
msgstr ""
867908

868-
#: ../../library/logging.config.rst:746
909+
#: ../../library/logging.config.rst:779
869910
msgid ""
870911
"For loggers other than the root logger, some additional information is "
871912
"required. This is illustrated by the following example."
872913
msgstr ""
873914

874-
#: ../../library/logging.config.rst:757
915+
#: ../../library/logging.config.rst:790
875916
msgid ""
876917
"The ``level`` and ``handlers`` entries are interpreted as for the root "
877918
"logger, except that if a non-root logger's level is specified as ``NOTSET``, "
@@ -884,28 +925,28 @@ msgid ""
884925
"application to get the logger."
885926
msgstr ""
886927

887-
#: ../../library/logging.config.rst:766
928+
#: ../../library/logging.config.rst:799
888929
msgid ""
889930
"Sections which specify handler configuration are exemplified by the "
890931
"following."
891932
msgstr ""
892933

893-
#: ../../library/logging.config.rst:776
934+
#: ../../library/logging.config.rst:809
894935
msgid ""
895936
"The ``class`` entry indicates the handler's class (as determined by :func:"
896937
"`eval` in the ``logging`` package's namespace). The ``level`` is interpreted "
897938
"as for loggers, and ``NOTSET`` is taken to mean 'log everything'."
898939
msgstr ""
899940

900-
#: ../../library/logging.config.rst:780
941+
#: ../../library/logging.config.rst:813
901942
msgid ""
902943
"The ``formatter`` entry indicates the key name of the formatter for this "
903944
"handler. If blank, a default formatter (``logging._defaultFormatter``) is "
904945
"used. If a name is specified, it must appear in the ``[formatters]`` section "
905946
"and have a corresponding section in the configuration file."
906947
msgstr ""
907948

908-
#: ../../library/logging.config.rst:785
949+
#: ../../library/logging.config.rst:818
909950
msgid ""
910951
"The ``args`` entry, when :ref:`evaluated <func-eval>` in the context of the "
911952
"``logging`` package's namespace, is the list of arguments to the constructor "
@@ -914,27 +955,27 @@ msgid ""
914955
"provided, it defaults to ``()``."
915956
msgstr ""
916957

917-
#: ../../library/logging.config.rst:791
958+
#: ../../library/logging.config.rst:824
918959
msgid ""
919960
"The optional ``kwargs`` entry, when :ref:`evaluated <func-eval>` in the "
920961
"context of the ``logging`` package's namespace, is the keyword argument dict "
921962
"to the constructor for the handler class. If not provided, it defaults to "
922963
"``{}``."
923964
msgstr ""
924965

925-
#: ../../library/logging.config.rst:848
966+
#: ../../library/logging.config.rst:881
926967
msgid ""
927968
"Sections which specify formatter configuration are typified by the following."
928969
msgstr ""
929970

930-
#: ../../library/logging.config.rst:859
971+
#: ../../library/logging.config.rst:892
931972
msgid ""
932973
"The arguments for the formatter configuration are the same as the keys in "
933974
"the dictionary schema :ref:`formatters section <logging-config-dictschema-"
934975
"formatters>`."
935976
msgstr ""
936977

937-
#: ../../library/logging.config.rst:865
978+
#: ../../library/logging.config.rst:898
938979
msgid ""
939980
"Due to the use of :func:`eval` as described above, there are potential "
940981
"security risks which result from using the :func:`listen` to send and "
@@ -943,18 +984,18 @@ msgid ""
943984
"`listen` documentation for more information."
944985
msgstr ""
945986

946-
#: ../../library/logging.config.rst:874
987+
#: ../../library/logging.config.rst:907
947988
msgid "Module :mod:`logging`"
948989
msgstr ":mod:`logging` 模組"
949990

950-
#: ../../library/logging.config.rst:874
991+
#: ../../library/logging.config.rst:907
951992
msgid "API reference for the logging module."
952993
msgstr ""
953994

954-
#: ../../library/logging.config.rst:876
995+
#: ../../library/logging.config.rst:909
955996
msgid "Module :mod:`logging.handlers`"
956997
msgstr ":mod:`logging.handlers` 模組"
957998

958-
#: ../../library/logging.config.rst:877
999+
#: ../../library/logging.config.rst:910
9591000
msgid "Useful handlers included with the logging module."
9601001
msgstr ""

0 commit comments

Comments
 (0)
0