7
7
msgstr ""
8
8
"Project-Id-Version : Python 3.12\n "
9
9
"Report-Msgid-Bugs-To : \n "
10
- "POT-Creation-Date : 2024-02-13 00:03+0000\n "
10
+ "POT-Creation-Date : 2024-03-14 00:03+0000\n "
11
11
"PO-Revision-Date : 2018-05-23 14:36+0000\n "
12
12
"
Last-Translator :
Adrian Liaw <[email protected] >\n "
13
13
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
@@ -1062,27 +1062,27 @@ msgid ""
1062
1062
"kinds of queues, for example a ZeroMQ 'subscribe' socket. Here's an example::"
1063
1063
msgstr ""
1064
1064
1065
- #: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3950
1065
+ #: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3973
1066
1066
msgid "Module :mod:`logging`"
1067
1067
msgstr ":mod:`logging` 模組"
1068
1068
1069
- #: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3950
1069
+ #: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3973
1070
1070
msgid "API reference for the logging module."
1071
1071
msgstr ""
1072
1072
1073
- #: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3953
1073
+ #: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3976
1074
1074
msgid "Module :mod:`logging.config`"
1075
1075
msgstr ":mod:`logging.config` 模組"
1076
1076
1077
- #: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3953
1077
+ #: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3976
1078
1078
msgid "Configuration API for the logging module."
1079
1079
msgstr ""
1080
1080
1081
- #: ../../howto/logging-cookbook.rst:1916 ../../howto/logging-cookbook.rst:3956
1081
+ #: ../../howto/logging-cookbook.rst:1916 ../../howto/logging-cookbook.rst:3979
1082
1082
msgid "Module :mod:`logging.handlers`"
1083
1083
msgstr ":mod:`logging.handlers` 模組"
1084
1084
1085
- #: ../../howto/logging-cookbook.rst:1916 ../../howto/logging-cookbook.rst:3956
1085
+ #: ../../howto/logging-cookbook.rst:1916 ../../howto/logging-cookbook.rst:3979
1086
1086
msgid "Useful handlers included with the logging module."
1087
1087
msgstr ""
1088
1088
@@ -1853,17 +1853,17 @@ msgstr ""
1853
1853
1854
1854
#: ../../howto/logging-cookbook.rst:3421
1855
1855
msgid ""
1856
- "The code should work with recent releases of either ``PySide2`` or "
1857
- "``PyQt5``. You should be able to adapt the approach to earlier versions of "
1858
- "Qt. Please refer to the comments in the code snippet for more detailed "
1859
- "information."
1856
+ "The code should work with recent releases of either ``PySide6``, ``PyQt6``, "
1857
+ "``PySide2`` or `` PyQt5``. You should be able to adapt the approach to "
1858
+ "earlier versions of Qt. Please refer to the comments in the code snippet for "
1859
+ "more detailed information."
1860
1860
msgstr ""
1861
1861
1862
- #: ../../howto/logging-cookbook.rst:3635
1862
+ #: ../../howto/logging-cookbook.rst:3658
1863
1863
msgid "Logging to syslog with RFC5424 support"
1864
1864
msgstr ""
1865
1865
1866
- #: ../../howto/logging-cookbook.rst:3637
1866
+ #: ../../howto/logging-cookbook.rst:3660
1867
1867
msgid ""
1868
1868
"Although :rfc:`5424` dates from 2009, most syslog servers are configured by "
1869
1869
"default to use the older :rfc:`3164`, which hails from 2001. When "
@@ -1873,14 +1873,14 @@ msgid ""
1873
1873
"handlers.SysLogHandler` functionality has not been updated."
1874
1874
msgstr ""
1875
1875
1876
- #: ../../howto/logging-cookbook.rst:3644
1876
+ #: ../../howto/logging-cookbook.rst:3667
1877
1877
msgid ""
1878
1878
"RFC 5424 contains some useful features such as support for structured data, "
1879
1879
"and if you need to be able to log to a syslog server with support for it, "
1880
1880
"you can do so with a subclassed handler which looks something like this::"
1881
1881
msgstr ""
1882
1882
1883
- #: ../../howto/logging-cookbook.rst:3710
1883
+ #: ../../howto/logging-cookbook.rst:3733
1884
1884
msgid ""
1885
1885
"You'll need to be familiar with RFC 5424 to fully understand the above code, "
1886
1886
"and it may be that you have slightly different needs (e.g. for how you pass "
@@ -1889,55 +1889,55 @@ msgid ""
1889
1889
"using something like this::"
1890
1890
msgstr ""
1891
1891
1892
- #: ../../howto/logging-cookbook.rst:3724
1892
+ #: ../../howto/logging-cookbook.rst:3747
1893
1893
msgid "How to treat a logger like an output stream"
1894
1894
msgstr ""
1895
1895
1896
- #: ../../howto/logging-cookbook.rst:3726
1896
+ #: ../../howto/logging-cookbook.rst:3749
1897
1897
msgid ""
1898
1898
"Sometimes, you need to interface to a third-party API which expects a file-"
1899
1899
"like object to write to, but you want to direct the API's output to a "
1900
1900
"logger. You can do this using a class which wraps a logger with a file-like "
1901
1901
"API. Here's a short script illustrating such a class:"
1902
1902
msgstr ""
1903
1903
1904
- #: ../../howto/logging-cookbook.rst:3766
1904
+ #: ../../howto/logging-cookbook.rst:3789
1905
1905
msgid "When this script is run, it prints"
1906
1906
msgstr ""
1907
1907
1908
- #: ../../howto/logging-cookbook.rst:3773
1908
+ #: ../../howto/logging-cookbook.rst:3796
1909
1909
msgid ""
1910
1910
"You could also use ``LoggerWriter`` to redirect ``sys.stdout`` and ``sys."
1911
1911
"stderr`` by doing something like this:"
1912
1912
msgstr ""
1913
1913
1914
- #: ../../howto/logging-cookbook.rst:3783
1914
+ #: ../../howto/logging-cookbook.rst:3806
1915
1915
msgid ""
1916
1916
"You should do this *after* configuring logging for your needs. In the above "
1917
1917
"example, the :func:`~logging.basicConfig` call does this (using the ``sys."
1918
1918
"stderr`` value *before* it is overwritten by a ``LoggerWriter`` instance). "
1919
1919
"Then, you'd get this kind of result:"
1920
1920
msgstr ""
1921
1921
1922
- #: ../../howto/logging-cookbook.rst:3796
1922
+ #: ../../howto/logging-cookbook.rst:3819
1923
1923
msgid ""
1924
1924
"Of course, the examples above show output according to the format used by :"
1925
1925
"func:`~logging.basicConfig`, but you can use a different formatter when you "
1926
1926
"configure logging."
1927
1927
msgstr ""
1928
1928
1929
- #: ../../howto/logging-cookbook.rst:3800
1929
+ #: ../../howto/logging-cookbook.rst:3823
1930
1930
msgid ""
1931
1931
"Note that with the above scheme, you are somewhat at the mercy of buffering "
1932
1932
"and the sequence of write calls which you are intercepting. For example, "
1933
1933
"with the definition of ``LoggerWriter`` above, if you have the snippet"
1934
1934
msgstr ""
1935
1935
1936
- #: ../../howto/logging-cookbook.rst:3809
1936
+ #: ../../howto/logging-cookbook.rst:3832
1937
1937
msgid "then running the script results in"
1938
1938
msgstr ""
1939
1939
1940
- #: ../../howto/logging-cookbook.rst:3827
1940
+ #: ../../howto/logging-cookbook.rst:3850
1941
1941
msgid ""
1942
1942
"As you can see, this output isn't ideal. That's because the underlying code "
1943
1943
"which writes to ``sys.stderr`` makes multiple writes, each of which results "
@@ -1947,62 +1947,62 @@ msgid ""
1947
1947
"``LoggerWriter``:"
1948
1948
msgstr ""
1949
1949
1950
- #: ../../howto/logging-cookbook.rst:3852
1950
+ #: ../../howto/logging-cookbook.rst:3875
1951
1951
msgid ""
1952
1952
"This just buffers up stuff until a newline is seen, and then logs complete "
1953
1953
"lines. With this approach, you get better output:"
1954
1954
msgstr ""
1955
1955
1956
- #: ../../howto/logging-cookbook.rst:3868
1956
+ #: ../../howto/logging-cookbook.rst:3891
1957
1957
msgid "Patterns to avoid"
1958
1958
msgstr ""
1959
1959
1960
- #: ../../howto/logging-cookbook.rst:3870
1960
+ #: ../../howto/logging-cookbook.rst:3893
1961
1961
msgid ""
1962
1962
"Although the preceding sections have described ways of doing things you "
1963
1963
"might need to do or deal with, it is worth mentioning some usage patterns "
1964
1964
"which are *unhelpful*, and which should therefore be avoided in most cases. "
1965
1965
"The following sections are in no particular order."
1966
1966
msgstr ""
1967
1967
1968
- #: ../../howto/logging-cookbook.rst:3876
1968
+ #: ../../howto/logging-cookbook.rst:3899
1969
1969
msgid "Opening the same log file multiple times"
1970
1970
msgstr ""
1971
1971
1972
- #: ../../howto/logging-cookbook.rst:3878
1972
+ #: ../../howto/logging-cookbook.rst:3901
1973
1973
msgid ""
1974
1974
"On Windows, you will generally not be able to open the same file multiple "
1975
1975
"times as this will lead to a \" file is in use by another process\" error. "
1976
1976
"However, on POSIX platforms you'll not get any errors if you open the same "
1977
1977
"file multiple times. This could be done accidentally, for example by:"
1978
1978
msgstr ""
1979
1979
1980
- #: ../../howto/logging-cookbook.rst:3883
1980
+ #: ../../howto/logging-cookbook.rst:3906
1981
1981
msgid ""
1982
1982
"Adding a file handler more than once which references the same file (e.g. by "
1983
1983
"a copy/paste/forget-to-change error)."
1984
1984
msgstr ""
1985
1985
1986
- #: ../../howto/logging-cookbook.rst:3886
1986
+ #: ../../howto/logging-cookbook.rst:3909
1987
1987
msgid ""
1988
1988
"Opening two files that look different, as they have different names, but are "
1989
1989
"the same because one is a symbolic link to the other."
1990
1990
msgstr ""
1991
1991
1992
- #: ../../howto/logging-cookbook.rst:3889
1992
+ #: ../../howto/logging-cookbook.rst:3912
1993
1993
msgid ""
1994
1994
"Forking a process, following which both parent and child have a reference to "
1995
1995
"the same file. This might be through use of the :mod:`multiprocessing` "
1996
1996
"module, for example."
1997
1997
msgstr ""
1998
1998
1999
- #: ../../howto/logging-cookbook.rst:3893
1999
+ #: ../../howto/logging-cookbook.rst:3916
2000
2000
msgid ""
2001
2001
"Opening a file multiple times might *appear* to work most of the time, but "
2002
2002
"can lead to a number of problems in practice:"
2003
2003
msgstr ""
2004
2004
2005
- #: ../../howto/logging-cookbook.rst:3896
2005
+ #: ../../howto/logging-cookbook.rst:3919
2006
2006
msgid ""
2007
2007
"Logging output can be garbled because multiple threads or processes try to "
2008
2008
"write to the same file. Although logging guards against concurrent use of "
@@ -2011,7 +2011,7 @@ msgid ""
2011
2011
"different handler instances which happen to point to the same file."
2012
2012
msgstr ""
2013
2013
2014
- #: ../../howto/logging-cookbook.rst:3902
2014
+ #: ../../howto/logging-cookbook.rst:3925
2015
2015
msgid ""
2016
2016
"An attempt to delete a file (e.g. during file rotation) silently fails, "
2017
2017
"because there is another reference pointing to it. This can lead to "
@@ -2021,17 +2021,17 @@ msgid ""
2021
2021
"being supposedly in place."
2022
2022
msgstr ""
2023
2023
2024
- #: ../../howto/logging-cookbook.rst:3909
2024
+ #: ../../howto/logging-cookbook.rst:3932
2025
2025
msgid ""
2026
2026
"Use the techniques outlined in :ref:`multiple-processes` to circumvent such "
2027
2027
"issues."
2028
2028
msgstr ""
2029
2029
2030
- #: ../../howto/logging-cookbook.rst:3913
2030
+ #: ../../howto/logging-cookbook.rst:3936
2031
2031
msgid "Using loggers as attributes in a class or passing them as parameters"
2032
2032
msgstr ""
2033
2033
2034
- #: ../../howto/logging-cookbook.rst:3915
2034
+ #: ../../howto/logging-cookbook.rst:3938
2035
2035
msgid ""
2036
2036
"While there might be unusual cases where you'll need to do this, in general "
2037
2037
"there is no point because loggers are singletons. Code can always access a "
@@ -2042,25 +2042,25 @@ msgid ""
2042
2042
"module (and not the class) is the unit of software decomposition."
2043
2043
msgstr ""
2044
2044
2045
- #: ../../howto/logging-cookbook.rst:3924
2045
+ #: ../../howto/logging-cookbook.rst:3947
2046
2046
msgid ""
2047
2047
"Adding handlers other than :class:`~logging.NullHandler` to a logger in a "
2048
2048
"library"
2049
2049
msgstr ""
2050
2050
2051
- #: ../../howto/logging-cookbook.rst:3926
2051
+ #: ../../howto/logging-cookbook.rst:3949
2052
2052
msgid ""
2053
2053
"Configuring logging by adding handlers, formatters and filters is the "
2054
2054
"responsibility of the application developer, not the library developer. If "
2055
2055
"you are maintaining a library, ensure that you don't add handlers to any of "
2056
2056
"your loggers other than a :class:`~logging.NullHandler` instance."
2057
2057
msgstr ""
2058
2058
2059
- #: ../../howto/logging-cookbook.rst:3932
2059
+ #: ../../howto/logging-cookbook.rst:3955
2060
2060
msgid "Creating a lot of loggers"
2061
2061
msgstr ""
2062
2062
2063
- #: ../../howto/logging-cookbook.rst:3934
2063
+ #: ../../howto/logging-cookbook.rst:3957
2064
2064
msgid ""
2065
2065
"Loggers are singletons that are never freed during a script execution, and "
2066
2066
"so creating lots of loggers will use up memory which can't then be freed. "
@@ -2071,14 +2071,14 @@ msgid ""
2071
2071
"occasionally slightly more fine-grained than that)."
2072
2072
msgstr ""
2073
2073
2074
- #: ../../howto/logging-cookbook.rst:3945
2074
+ #: ../../howto/logging-cookbook.rst:3968
2075
2075
msgid "Other resources"
2076
2076
msgstr ""
2077
2077
2078
- #: ../../howto/logging-cookbook.rst:3958
2078
+ #: ../../howto/logging-cookbook.rst:3981
2079
2079
msgid ":ref:`Basic Tutorial <logging-basic-tutorial>`"
2080
2080
msgstr ":ref:`基礎教學 <logging-basic-tutorial>`"
2081
2081
2082
- #: ../../howto/logging-cookbook.rst:3960
2082
+ #: ../../howto/logging-cookbook.rst:3983
2083
2083
msgid ":ref:`Advanced Tutorial <logging-advanced-tutorial>`"
2084
2084
msgstr ":ref:`進階教學 <logging-advanced-tutorial>`"
0 commit comments