forked from python/python-docs-zh-tw
/
logging.po
2158 lines (1807 loc) · 73.1 KB
/
logging.po
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2022, Python Software Foundation
# This file is distributed under the same license as the Python package.
#
# Translators:
# Andy Dai <daikeren@gmail.com>, 2015
msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-02 00:03+0000\n"
"PO-Revision-Date: 2023-08-20 16:49+0800\n"
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.3.2\n"
#: ../../library/logging.rst:2
msgid ":mod:`logging` --- Logging facility for Python"
msgstr ":mod:`logging` --- Python 的日誌記錄工具"
#: ../../library/logging.rst:10
msgid "**Source code:** :source:`Lib/logging/__init__.py`"
msgstr "**原始碼:**\\ :source:`Lib/logging/__init__.py`"
#: ../../library/logging.rst:16
msgid ""
"This page contains the API reference information. For tutorial information "
"and discussion of more advanced topics, see"
msgstr "此頁面包含 API 參考訊息。有關教學流程和更進階的主題討論,請參閱"
#: ../../library/logging.rst:19
msgid ":ref:`Basic Tutorial <logging-basic-tutorial>`"
msgstr ":ref:`基礎教學 <logging-basic-tutorial>`"
#: ../../library/logging.rst:20
msgid ":ref:`Advanced Tutorial <logging-advanced-tutorial>`"
msgstr ":ref:`進階教學 <logging-advanced-tutorial>`"
#: ../../library/logging.rst:21
msgid ":ref:`Logging Cookbook <logging-cookbook>`"
msgstr ":ref:`日誌記錄手冊 <logging-cookbook>`"
#: ../../library/logging.rst:25
msgid ""
"This module defines functions and classes which implement a flexible event "
"logging system for applications and libraries."
msgstr ""
"這個模組定義了函式與類別 (class),為應用程式和函式庫實作彈性的日誌管理系統。"
#: ../../library/logging.rst:28
msgid ""
"The key benefit of having the logging API provided by a standard library "
"module is that all Python modules can participate in logging, so your "
"application log can include your own messages integrated with messages from "
"third-party modules."
msgstr ""
"由標準函式庫模組提供的日誌記錄 API 的主要好處是,所有的 Python 模組都能參與日"
"誌記錄,因此您的應用程式日誌可以包含您自己的訊息,並與來自第三方模組的訊息整"
"合在一起。"
#: ../../library/logging.rst:33
msgid "The simplest example:"
msgstr ""
#: ../../library/logging.rst:41
msgid ""
"The module provides a lot of functionality and flexibility. If you are "
"unfamiliar with logging, the best way to get to grips with it is to view the "
"tutorials (**see the links above and on the right**)."
msgstr ""
#: ../../library/logging.rst:45
msgid ""
"The basic classes defined by the module, together with their functions, are "
"listed below."
msgstr ""
#: ../../library/logging.rst:48
msgid "Loggers expose the interface that application code directly uses."
msgstr ""
#: ../../library/logging.rst:49
msgid ""
"Handlers send the log records (created by loggers) to the appropriate "
"destination."
msgstr ""
#: ../../library/logging.rst:51
msgid ""
"Filters provide a finer grained facility for determining which log records "
"to output."
msgstr ""
#: ../../library/logging.rst:53
msgid "Formatters specify the layout of log records in the final output."
msgstr "格式器指定日誌記錄在最終輸出中的佈局。"
#: ../../library/logging.rst:59
msgid "Logger Objects"
msgstr ""
#: ../../library/logging.rst:61
msgid ""
"Loggers have the following attributes and methods. Note that Loggers should "
"*NEVER* be instantiated directly, but always through the module-level "
"function ``logging.getLogger(name)``. Multiple calls to :func:`getLogger` "
"with the same name will always return a reference to the same Logger object."
msgstr ""
#: ../../library/logging.rst:66
msgid ""
"The ``name`` is potentially a period-separated hierarchical value, like "
"``foo.bar.baz`` (though it could also be just plain ``foo``, for example). "
"Loggers that are further down in the hierarchical list are children of "
"loggers higher up in the list. For example, given a logger with a name of "
"``foo``, loggers with names of ``foo.bar``, ``foo.bar.baz``, and ``foo.bam`` "
"are all descendants of ``foo``. The logger name hierarchy is analogous to "
"the Python package hierarchy, and identical to it if you organise your "
"loggers on a per-module basis using the recommended construction ``logging."
"getLogger(__name__)``. That's because in a module, ``__name__`` is the "
"module's name in the Python package namespace."
msgstr ""
#: ../../library/logging.rst:82
msgid ""
"If this attribute evaluates to true, events logged to this logger will be "
"passed to the handlers of higher level (ancestor) loggers, in addition to "
"any handlers attached to this logger. Messages are passed directly to the "
"ancestor loggers' handlers - neither the level nor filters of the ancestor "
"loggers in question are considered."
msgstr ""
#: ../../library/logging.rst:88
msgid ""
"If this evaluates to false, logging messages are not passed to the handlers "
"of ancestor loggers."
msgstr ""
#: ../../library/logging.rst:91
msgid ""
"Spelling it out with an example: If the propagate attribute of the logger "
"named ``A.B.C`` evaluates to true, any event logged to ``A.B.C`` via a "
"method call such as ``logging.getLogger('A.B.C').error(...)`` will [subject "
"to passing that logger's level and filter settings] be passed in turn to any "
"handlers attached to loggers named ``A.B``, ``A`` and the root logger, after "
"first being passed to any handlers attached to ``A.B.C``. If any logger in "
"the chain ``A.B.C``, ``A.B``, ``A`` has its ``propagate`` attribute set to "
"false, then that is the last logger whose handlers are offered the event to "
"handle, and propagation stops at that point."
msgstr ""
#: ../../library/logging.rst:100
msgid "The constructor sets this attribute to ``True``."
msgstr "此建構函式將該屬性設為 ``True``。"
#: ../../library/logging.rst:102
msgid ""
"If you attach a handler to a logger *and* one or more of its ancestors, it "
"may emit the same record multiple times. In general, you should not need to "
"attach a handler to more than one logger - if you just attach it to the "
"appropriate logger which is highest in the logger hierarchy, then it will "
"see all events logged by all descendant loggers, provided that their "
"propagate setting is left set to ``True``. A common scenario is to attach "
"handlers only to the root logger, and to let propagation take care of the "
"rest."
msgstr ""
#: ../../library/logging.rst:113
msgid ""
"Sets the threshold for this logger to *level*. Logging messages which are "
"less severe than *level* will be ignored; logging messages which have "
"severity *level* or higher will be emitted by whichever handler or handlers "
"service this logger, unless a handler's level has been set to a higher "
"severity level than *level*."
msgstr ""
#: ../../library/logging.rst:118
msgid ""
"When a logger is created, the level is set to :const:`NOTSET` (which causes "
"all messages to be processed when the logger is the root logger, or "
"delegation to the parent when the logger is a non-root logger). Note that "
"the root logger is created with level :const:`WARNING`."
msgstr ""
#: ../../library/logging.rst:123
msgid ""
"The term 'delegation to the parent' means that if a logger has a level of "
"NOTSET, its chain of ancestor loggers is traversed until either an ancestor "
"with a level other than NOTSET is found, or the root is reached."
msgstr ""
#: ../../library/logging.rst:127
msgid ""
"If an ancestor is found with a level other than NOTSET, then that ancestor's "
"level is treated as the effective level of the logger where the ancestor "
"search began, and is used to determine how a logging event is handled."
msgstr ""
#: ../../library/logging.rst:131
msgid ""
"If the root is reached, and it has a level of NOTSET, then all messages will "
"be processed. Otherwise, the root's level will be used as the effective "
"level."
msgstr ""
#: ../../library/logging.rst:134 ../../library/logging.rst:477
msgid "See :ref:`levels` for a list of levels."
msgstr "層級清單請見 :ref:`levels`\\ 。"
#: ../../library/logging.rst:136
msgid ""
"The *level* parameter now accepts a string representation of the level such "
"as 'INFO' as an alternative to the integer constants such as :const:`INFO`. "
"Note, however, that levels are internally stored as integers, and methods "
"such as e.g. :meth:`getEffectiveLevel` and :meth:`isEnabledFor` will return/"
"expect to be passed integers."
msgstr ""
#: ../../library/logging.rst:146
msgid ""
"Indicates if a message of severity *level* would be processed by this "
"logger. This method checks first the module-level level set by ``logging."
"disable(level)`` and then the logger's effective level as determined by :"
"meth:`getEffectiveLevel`."
msgstr ""
#: ../../library/logging.rst:154
msgid ""
"Indicates the effective level for this logger. If a value other than :const:"
"`NOTSET` has been set using :meth:`setLevel`, it is returned. Otherwise, the "
"hierarchy is traversed towards the root until a value other than :const:"
"`NOTSET` is found, and that value is returned. The value returned is an "
"integer, typically one of :const:`logging.DEBUG`, :const:`logging.INFO` etc."
msgstr ""
#: ../../library/logging.rst:164
msgid ""
"Returns a logger which is a descendant to this logger, as determined by the "
"suffix. Thus, ``logging.getLogger('abc').getChild('def.ghi')`` would return "
"the same logger as would be returned by ``logging.getLogger('abc.def."
"ghi')``. This is a convenience method, useful when the parent logger is "
"named using e.g. ``__name__`` rather than a literal string."
msgstr ""
#: ../../library/logging.rst:175
msgid ""
"Returns a set of loggers which are immediate children of this logger. So for "
"example ``logging.getLogger().getChildren()`` might return a set containing "
"loggers named ``foo`` and ``bar``, but a logger named ``foo.bar`` wouldn't "
"be included in the set. Likewise, ``logging.getLogger('foo').getChildren()`` "
"might return a set including a logger named ``foo.bar``, but it wouldn't "
"include one named ``foo.bar.baz``."
msgstr ""
#: ../../library/logging.rst:187
msgid ""
"Logs a message with level :const:`DEBUG` on this logger. The *msg* is the "
"message format string, and the *args* are the arguments which are merged "
"into *msg* using the string formatting operator. (Note that this means that "
"you can use keywords in the format string, together with a single dictionary "
"argument.) No % formatting operation is performed on *msg* when no *args* "
"are supplied."
msgstr ""
#: ../../library/logging.rst:193
msgid ""
"There are four keyword arguments in *kwargs* which are inspected: "
"*exc_info*, *stack_info*, *stacklevel* and *extra*."
msgstr ""
#: ../../library/logging.rst:196
msgid ""
"If *exc_info* does not evaluate as false, it causes exception information to "
"be added to the logging message. If an exception tuple (in the format "
"returned by :func:`sys.exc_info`) or an exception instance is provided, it "
"is used; otherwise, :func:`sys.exc_info` is called to get the exception "
"information."
msgstr ""
#: ../../library/logging.rst:201 ../../library/logging.rst:1116
msgid ""
"The second optional keyword argument is *stack_info*, which defaults to "
"``False``. If true, stack information is added to the logging message, "
"including the actual logging call. Note that this is not the same stack "
"information as that displayed through specifying *exc_info*: The former is "
"stack frames from the bottom of the stack up to the logging call in the "
"current thread, whereas the latter is information about stack frames which "
"have been unwound, following an exception, while searching for exception "
"handlers."
msgstr ""
#: ../../library/logging.rst:210 ../../library/logging.rst:1125
msgid ""
"You can specify *stack_info* independently of *exc_info*, e.g. to just show "
"how you got to a certain point in your code, even when no exceptions were "
"raised. The stack frames are printed following a header line which says:"
msgstr ""
#: ../../library/logging.rst:218 ../../library/logging.rst:1133
msgid ""
"This mimics the ``Traceback (most recent call last):`` which is used when "
"displaying exception frames."
msgstr ""
#: ../../library/logging.rst:221
msgid ""
"The third optional keyword argument is *stacklevel*, which defaults to "
"``1``. If greater than 1, the corresponding number of stack frames are "
"skipped when computing the line number and function name set in the :class:"
"`LogRecord` created for the logging event. This can be used in logging "
"helpers so that the function name, filename and line number recorded are not "
"the information for the helper function/method, but rather its caller. The "
"name of this parameter mirrors the equivalent one in the :mod:`warnings` "
"module."
msgstr ""
#: ../../library/logging.rst:229
msgid ""
"The fourth keyword argument is *extra* which can be used to pass a "
"dictionary which is used to populate the __dict__ of the :class:`LogRecord` "
"created for the logging event with user-defined attributes. These custom "
"attributes can then be used as you like. For example, they could be "
"incorporated into logged messages. For example::"
msgstr ""
#: ../../library/logging.rst:241
msgid "would print something like"
msgstr ""
#: ../../library/logging.rst:247
msgid ""
"The keys in the dictionary passed in *extra* should not clash with the keys "
"used by the logging system. (See the section on :ref:`logrecord-attributes` "
"for more information on which keys are used by the logging system.)"
msgstr ""
#: ../../library/logging.rst:251
msgid ""
"If you choose to use these attributes in logged messages, you need to "
"exercise some care. In the above example, for instance, the :class:"
"`Formatter` has been set up with a format string which expects 'clientip' "
"and 'user' in the attribute dictionary of the :class:`LogRecord`. If these "
"are missing, the message will not be logged because a string formatting "
"exception will occur. So in this case, you always need to pass the *extra* "
"dictionary with these keys."
msgstr ""
#: ../../library/logging.rst:258 ../../library/logging.rst:1164
msgid ""
"While this might be annoying, this feature is intended for use in "
"specialized circumstances, such as multi-threaded servers where the same "
"code executes in many contexts, and interesting conditions which arise are "
"dependent on this context (such as remote client IP address and "
"authenticated user name, in the above example). In such circumstances, it is "
"likely that specialized :class:`Formatter`\\ s would be used with "
"particular :class:`Handler`\\ s."
msgstr ""
#: ../../library/logging.rst:265
msgid ""
"If no handler is attached to this logger (or any of its ancestors, taking "
"into account the relevant :attr:`Logger.propagate` attributes), the message "
"will be sent to the handler set on :attr:`lastResort`."
msgstr ""
#: ../../library/logging.rst:269 ../../library/logging.rst:1175
msgid "The *stack_info* parameter was added."
msgstr "新增 *stack_info* 參數。"
#: ../../library/logging.rst:272
msgid "The *exc_info* parameter can now accept exception instances."
msgstr ""
#: ../../library/logging.rst:275
msgid "The *stacklevel* parameter was added."
msgstr "新增 *stacklevel* 參數。"
#: ../../library/logging.rst:281
msgid ""
"Logs a message with level :const:`INFO` on this logger. The arguments are "
"interpreted as for :meth:`debug`."
msgstr ""
#: ../../library/logging.rst:287
msgid ""
"Logs a message with level :const:`WARNING` on this logger. The arguments are "
"interpreted as for :meth:`debug`."
msgstr ""
#: ../../library/logging.rst:290
msgid ""
"There is an obsolete method ``warn`` which is functionally identical to "
"``warning``. As ``warn`` is deprecated, please do not use it - use "
"``warning`` instead."
msgstr ""
#: ../../library/logging.rst:296
msgid ""
"Logs a message with level :const:`ERROR` on this logger. The arguments are "
"interpreted as for :meth:`debug`."
msgstr ""
#: ../../library/logging.rst:302
msgid ""
"Logs a message with level :const:`CRITICAL` on this logger. The arguments "
"are interpreted as for :meth:`debug`."
msgstr ""
#: ../../library/logging.rst:308
msgid ""
"Logs a message with integer level *level* on this logger. The other "
"arguments are interpreted as for :meth:`debug`."
msgstr ""
#: ../../library/logging.rst:314
msgid ""
"Logs a message with level :const:`ERROR` on this logger. The arguments are "
"interpreted as for :meth:`debug`. Exception info is added to the logging "
"message. This method should only be called from an exception handler."
msgstr ""
#: ../../library/logging.rst:321
msgid "Adds the specified filter *filter* to this logger."
msgstr "在該 logger 內增加指定的 filter *filter*。"
#: ../../library/logging.rst:326
msgid "Removes the specified filter *filter* from this logger."
msgstr "在該 logger 內移除指定的 filter *filter*。"
#: ../../library/logging.rst:331
msgid ""
"Apply this logger's filters to the record and return ``True`` if the record "
"is to be processed. The filters are consulted in turn, until one of them "
"returns a false value. If none of them return a false value, the record will "
"be processed (passed to handlers). If one returns a false value, no further "
"processing of the record occurs."
msgstr ""
#: ../../library/logging.rst:340
msgid "Adds the specified handler *hdlr* to this logger."
msgstr ""
#: ../../library/logging.rst:345
msgid "Removes the specified handler *hdlr* from this logger."
msgstr ""
#: ../../library/logging.rst:350
msgid ""
"Finds the caller's source filename and line number. Returns the filename, "
"line number, function name and stack information as a 4-element tuple. The "
"stack information is returned as ``None`` unless *stack_info* is ``True``."
msgstr ""
#: ../../library/logging.rst:354
msgid ""
"The *stacklevel* parameter is passed from code calling the :meth:`debug` and "
"other APIs. If greater than 1, the excess is used to skip stack frames "
"before determining the values to be returned. This will generally be useful "
"when calling logging APIs from helper/wrapper code, so that the information "
"in the event log refers not to the helper/wrapper code, but to the code that "
"calls it."
msgstr ""
#: ../../library/logging.rst:364
msgid ""
"Handles a record by passing it to all handlers associated with this logger "
"and its ancestors (until a false value of *propagate* is found). This method "
"is used for unpickled records received from a socket, as well as those "
"created locally. Logger-level filtering is applied using :meth:`~Logger."
"filter`."
msgstr ""
#: ../../library/logging.rst:372
msgid ""
"This is a factory method which can be overridden in subclasses to create "
"specialized :class:`LogRecord` instances."
msgstr ""
#: ../../library/logging.rst:377
msgid ""
"Checks to see if this logger has any handlers configured. This is done by "
"looking for handlers in this logger and its parents in the logger hierarchy. "
"Returns ``True`` if a handler was found, else ``False``. The method stops "
"searching up the hierarchy whenever a logger with the 'propagate' attribute "
"set to false is found - that will be the last logger which is checked for "
"the existence of handlers."
msgstr ""
#: ../../library/logging.rst:386
msgid "Loggers can now be pickled and unpickled."
msgstr ""
#: ../../library/logging.rst:392
msgid "Logging Levels"
msgstr ""
#: ../../library/logging.rst:394
msgid ""
"The numeric values of logging levels are given in the following table. These "
"are primarily of interest if you want to define your own levels, and need "
"them to have specific values relative to the predefined levels. If you "
"define a level with the same numeric value, it overwrites the predefined "
"value; the predefined name is lost."
msgstr ""
#: ../../library/logging.rst:401
msgid "Level"
msgstr ""
#: ../../library/logging.rst:401
msgid "Numeric value"
msgstr ""
#: ../../library/logging.rst:401
msgid "What it means / When to use it"
msgstr ""
#: ../../library/logging.rst:403
msgid "0"
msgstr "0"
#: ../../library/logging.rst:403
msgid ""
"When set on a logger, indicates that ancestor loggers are to be consulted to "
"determine the effective level. If that still resolves to :const:`!NOTSET`, "
"then all events are logged. When set on a handler, all events are handled."
msgstr ""
#: ../../library/logging.rst:411
msgid "10"
msgstr "10"
#: ../../library/logging.rst:411
msgid ""
"Detailed information, typically only of interest to a developer trying to "
"diagnose a problem."
msgstr ""
#: ../../library/logging.rst:415
msgid "20"
msgstr "20"
#: ../../library/logging.rst:415
msgid "Confirmation that things are working as expected."
msgstr ""
#: ../../library/logging.rst:418
msgid "30"
msgstr "30"
#: ../../library/logging.rst:418
msgid ""
"An indication that something unexpected happened, or that a problem might "
"occur in the near future (e.g. 'disk space low'). The software is still "
"working as expected."
msgstr ""
#: ../../library/logging.rst:425
msgid "40"
msgstr "40"
#: ../../library/logging.rst:425
msgid ""
"Due to a more serious problem, the software has not been able to perform "
"some function."
msgstr ""
#: ../../library/logging.rst:429
msgid "50"
msgstr "50"
#: ../../library/logging.rst:429
msgid ""
"A serious error, indicating that the program itself may be unable to "
"continue running."
msgstr ""
#: ../../library/logging.rst:438
msgid "Handler Objects"
msgstr ""
#: ../../library/logging.rst:440
msgid ""
"Handlers have the following attributes and methods. Note that :class:"
"`Handler` is never instantiated directly; this class acts as a base for more "
"useful subclasses. However, the :meth:`!__init__` method in subclasses needs "
"to call :meth:`Handler.__init__`."
msgstr ""
#: ../../library/logging.rst:449
msgid ""
"Initializes the :class:`Handler` instance by setting its level, setting the "
"list of filters to the empty list and creating a lock (using :meth:"
"`createLock`) for serializing access to an I/O mechanism."
msgstr ""
#: ../../library/logging.rst:456
msgid ""
"Initializes a thread lock which can be used to serialize access to "
"underlying I/O functionality which may not be threadsafe."
msgstr ""
#: ../../library/logging.rst:462
msgid "Acquires the thread lock created with :meth:`createLock`."
msgstr ""
#: ../../library/logging.rst:467
msgid "Releases the thread lock acquired with :meth:`acquire`."
msgstr ""
#: ../../library/logging.rst:472
msgid ""
"Sets the threshold for this handler to *level*. Logging messages which are "
"less severe than *level* will be ignored. When a handler is created, the "
"level is set to :const:`NOTSET` (which causes all messages to be processed)."
msgstr ""
#: ../../library/logging.rst:479
msgid ""
"The *level* parameter now accepts a string representation of the level such "
"as 'INFO' as an alternative to the integer constants such as :const:`INFO`."
msgstr ""
#: ../../library/logging.rst:487
msgid "Sets the :class:`Formatter` for this handler to *fmt*."
msgstr ""
#: ../../library/logging.rst:492
msgid "Adds the specified filter *filter* to this handler."
msgstr ""
#: ../../library/logging.rst:497
msgid "Removes the specified filter *filter* from this handler."
msgstr ""
#: ../../library/logging.rst:502
msgid ""
"Apply this handler's filters to the record and return ``True`` if the record "
"is to be processed. The filters are consulted in turn, until one of them "
"returns a false value. If none of them return a false value, the record will "
"be emitted. If one returns a false value, the handler will not emit the "
"record."
msgstr ""
#: ../../library/logging.rst:511
msgid ""
"Ensure all logging output has been flushed. This version does nothing and is "
"intended to be implemented by subclasses."
msgstr ""
#: ../../library/logging.rst:517
msgid ""
"Tidy up any resources used by the handler. This version does no output but "
"removes the handler from an internal list of handlers which is closed when :"
"func:`shutdown` is called. Subclasses should ensure that this gets called "
"from overridden :meth:`close` methods."
msgstr ""
#: ../../library/logging.rst:525
msgid ""
"Conditionally emits the specified logging record, depending on filters which "
"may have been added to the handler. Wraps the actual emission of the record "
"with acquisition/release of the I/O thread lock."
msgstr ""
#: ../../library/logging.rst:532
msgid ""
"This method should be called from handlers when an exception is encountered "
"during an :meth:`emit` call. If the module-level attribute :data:"
"`raiseExceptions` is ``False``, exceptions get silently ignored. This is "
"what is mostly wanted for a logging system - most users will not care about "
"errors in the logging system, they are more interested in application "
"errors. You could, however, replace this with a custom handler if you wish. "
"The specified record is the one which was being processed when the exception "
"occurred. (The default value of :data:`raiseExceptions` is ``True``, as that "
"is more useful during development)."
msgstr ""
#: ../../library/logging.rst:545
msgid ""
"Do formatting for a record - if a formatter is set, use it. Otherwise, use "
"the default formatter for the module."
msgstr ""
#: ../../library/logging.rst:551
msgid ""
"Do whatever it takes to actually log the specified logging record. This "
"version is intended to be implemented by subclasses and so raises a :exc:"
"`NotImplementedError`."
msgstr ""
#: ../../library/logging.rst:555
msgid ""
"This method is called after a handler-level lock is acquired, which is "
"released after this method returns. When you override this method, note that "
"you should be careful when calling anything that invokes other parts of the "
"logging API which might do locking, because that might result in a deadlock. "
"Specifically:"
msgstr ""
#: ../../library/logging.rst:561
msgid ""
"Logging configuration APIs acquire the module-level lock, and then "
"individual handler-level locks as those handlers are configured."
msgstr ""
#: ../../library/logging.rst:564
msgid ""
"Many logging APIs lock the module-level lock. If such an API is called from "
"this method, it could cause a deadlock if a configuration call is made on "
"another thread, because that thread will try to acquire the module-level "
"lock *before* the handler-level lock, whereas this thread tries to acquire "
"the module-level lock *after* the handler-level lock (because in this "
"method, the handler-level lock has already been acquired)."
msgstr ""
#: ../../library/logging.rst:571
msgid ""
"For a list of handlers included as standard, see :mod:`logging.handlers`."
msgstr ""
#: ../../library/logging.rst:576
msgid "Formatter Objects"
msgstr ""
#: ../../library/logging.rst:582
msgid ""
"Responsible for converting a :class:`LogRecord` to an output string to be "
"interpreted by a human or external system."
msgstr ""
#: ../../library/logging.rst:0
msgid "Parameters"
msgstr ""
#: ../../library/logging.rst:585
msgid ""
"A format string in the given *style* for the logged output as a whole. The "
"possible mapping keys are drawn from the :class:`LogRecord` object's :ref:"
"`logrecord-attributes`. If not specified, ``'%(message)s'`` is used, which "
"is just the logged message."
msgstr ""
#: ../../library/logging.rst:593
msgid ""
"A format string in the given *style* for the date/time portion of the logged "
"output. If not specified, the default described in :meth:`formatTime` is "
"used."
msgstr ""
#: ../../library/logging.rst:598
msgid ""
"Can be one of ``'%'``, ``'{'`` or ``'$'`` and determines how the format "
"string will be merged with its data: using one of :ref:`old-string-"
"formatting` (``%``), :meth:`str.format` (``{``) or :class:`string.Template` "
"(``$``). This only applies to *fmt* and *datefmt* (e.g. ``'%(message)s'`` "
"versus ``'{message}'``), not to the actual log messages passed to the "
"logging methods. However, there are :ref:`other ways <formatting-styles>` to "
"use ``{``- and ``$``-formatting for log messages."
msgstr ""
#: ../../library/logging.rst:608
msgid ""
"If ``True`` (the default), incorrect or mismatched *fmt* and *style* will "
"raise a :exc:`ValueError`; for example, ``logging.Formatter('%(asctime)s - "
"%(message)s', style='{')``."
msgstr ""
#: ../../library/logging.rst:613
msgid ""
"A dictionary with default values to use in custom fields. For example, "
"``logging.Formatter('%(ip)s %(message)s', defaults={\"ip\": None})``"
msgstr ""
#: ../../library/logging.rst:618
msgid "Added the *style* parameter."
msgstr "新增 *style* 參數。"
#: ../../library/logging.rst:621
msgid "Added the *validate* parameter."
msgstr "新增 *validate* 參數。"
#: ../../library/logging.rst:624
msgid "Added the *defaults* parameter."
msgstr "新增 *defaults* 參數。"
#: ../../library/logging.rst:630
msgid ""
"The record's attribute dictionary is used as the operand to a string "
"formatting operation. Returns the resulting string. Before formatting the "
"dictionary, a couple of preparatory steps are carried out. The *message* "
"attribute of the record is computed using *msg* % *args*. If the formatting "
"string contains ``'(asctime)'``, :meth:`formatTime` is called to format the "
"event time. If there is exception information, it is formatted using :meth:"
"`formatException` and appended to the message. Note that the formatted "
"exception information is cached in attribute *exc_text*. This is useful "
"because the exception information can be pickled and sent across the wire, "
"but you should be careful if you have more than one :class:`Formatter` "
"subclass which customizes the formatting of exception information. In this "
"case, you will have to clear the cached value (by setting the *exc_text* "
"attribute to ``None``) after a formatter has done its formatting, so that "
"the next formatter to handle the event doesn't use the cached value, but "
"recalculates it afresh."
msgstr ""
#: ../../library/logging.rst:646
msgid ""
"If stack information is available, it's appended after the exception "
"information, using :meth:`formatStack` to transform it if necessary."
msgstr ""
#: ../../library/logging.rst:652
msgid ""
"This method should be called from :meth:`format` by a formatter which wants "
"to make use of a formatted time. This method can be overridden in formatters "
"to provide for any specific requirement, but the basic behavior is as "
"follows: if *datefmt* (a string) is specified, it is used with :func:`time."
"strftime` to format the creation time of the record. Otherwise, the format "
"'%Y-%m-%d %H:%M:%S,uuu' is used, where the uuu part is a millisecond value "
"and the other letters are as per the :func:`time.strftime` documentation. "
"An example time in this format is ``2003-01-23 00:29:50,411``. The "
"resulting string is returned."
msgstr ""
#: ../../library/logging.rst:662
msgid ""
"This function uses a user-configurable function to convert the creation time "
"to a tuple. By default, :func:`time.localtime` is used; to change this for a "
"particular formatter instance, set the ``converter`` attribute to a function "
"with the same signature as :func:`time.localtime` or :func:`time.gmtime`. To "
"change it for all formatters, for example if you want all logging times to "
"be shown in GMT, set the ``converter`` attribute in the ``Formatter`` class."
msgstr ""
#: ../../library/logging.rst:670
msgid ""
"Previously, the default format was hard-coded as in this example: "
"``2010-09-06 22:38:15,292`` where the part before the comma is handled by a "
"strptime format string (``'%Y-%m-%d %H:%M:%S'``), and the part after the "
"comma is a millisecond value. Because strptime does not have a format "
"placeholder for milliseconds, the millisecond value is appended using "
"another format string, ``'%s,%03d'`` --- and both of these format strings "
"have been hardcoded into this method. With the change, these strings are "
"defined as class-level attributes which can be overridden at the instance "
"level when desired. The names of the attributes are ``default_time_format`` "
"(for the strptime format string) and ``default_msec_format`` (for appending "
"the millisecond value)."
msgstr ""
#: ../../library/logging.rst:683
msgid "The ``default_msec_format`` can be ``None``."
msgstr ""
#: ../../library/logging.rst:688
msgid ""
"Formats the specified exception information (a standard exception tuple as "
"returned by :func:`sys.exc_info`) as a string. This default implementation "
"just uses :func:`traceback.print_exception`. The resulting string is "
"returned."
msgstr ""
#: ../../library/logging.rst:695
msgid ""
"Formats the specified stack information (a string as returned by :func:"
"`traceback.print_stack`, but with the last newline removed) as a string. "
"This default implementation just returns the input value."
msgstr ""
#: ../../library/logging.rst:701
msgid ""
"A base formatter class suitable for subclassing when you want to format a "
"number of records. You can pass a :class:`Formatter` instance which you want "
"to use to format each line (that corresponds to a single record). If not "
"specified, the default formatter (which just outputs the event message) is "
"used as the line formatter."
msgstr ""
#: ../../library/logging.rst:709
msgid ""
"Return a header for a list of *records*. The base implementation just "
"returns the empty string. You will need to override this method if you want "
"specific behaviour, e.g. to show the count of records, a title or a "
"separator line."
msgstr ""
#: ../../library/logging.rst:716
msgid ""
"Return a footer for a list of *records*. The base implementation just "
"returns the empty string. You will need to override this method if you want "
"specific behaviour, e.g. to show the count of records or a separator line."
msgstr ""
#: ../../library/logging.rst:723
msgid ""
"Return formatted text for a list of *records*. The base implementation just "
"returns the empty string if there are no records; otherwise, it returns the "
"concatenation of the header, each record formatted with the line formatter, "
"and the footer."
msgstr ""
#: ../../library/logging.rst:731
msgid "Filter Objects"
msgstr ""
#: ../../library/logging.rst:733
msgid ""
"``Filters`` can be used by ``Handlers`` and ``Loggers`` for more "
"sophisticated filtering than is provided by levels. The base filter class "
"only allows events which are below a certain point in the logger hierarchy. "
"For example, a filter initialized with 'A.B' will allow events logged by "
"loggers 'A.B', 'A.B.C', 'A.B.C.D', 'A.B.D' etc. but not 'A.BB', 'B.A.B' etc. "
"If initialized with the empty string, all events are passed."
msgstr ""
#: ../../library/logging.rst:743
msgid ""
"Returns an instance of the :class:`Filter` class. If *name* is specified, it "
"names a logger which, together with its children, will have its events "
"allowed through the filter. If *name* is the empty string, allows every "
"event."
msgstr ""
#: ../../library/logging.rst:750
msgid ""
"Is the specified record to be logged? Returns false for no, true for yes. "
"Filters can either modify log records in-place or return a completely "
"different record instance which will replace the original log record in any "
"future processing of the event."
msgstr ""
#: ../../library/logging.rst:755
msgid ""
"Note that filters attached to handlers are consulted before an event is "
"emitted by the handler, whereas filters attached to loggers are consulted "
"whenever an event is logged (using :meth:`debug`, :meth:`info`, etc.), "
"before sending an event to handlers. This means that events which have been "
"generated by descendant loggers will not be filtered by a logger's filter "
"setting, unless the filter has also been applied to those descendant loggers."
msgstr ""
#: ../../library/logging.rst:762
msgid ""
"You don't actually need to subclass ``Filter``: you can pass any instance "
"which has a ``filter`` method with the same semantics."
msgstr ""
#: ../../library/logging.rst:765
msgid ""
"You don't need to create specialized ``Filter`` classes, or use other "
"classes with a ``filter`` method: you can use a function (or other callable) "
"as a filter. The filtering logic will check to see if the filter object has "
"a ``filter`` attribute: if it does, it's assumed to be a ``Filter`` and its :"
"meth:`~Filter.filter` method is called. Otherwise, it's assumed to be a "
"callable and called with the record as the single parameter. The returned "
"value should conform to that returned by :meth:`~Filter.filter`."
msgstr ""
#: ../../library/logging.rst:775
msgid ""
"You can now return a :class:`LogRecord` instance from filters to replace the "
"log record rather than modifying it in place. This allows filters attached "
"to a :class:`Handler` to modify the log record before it is emitted, without "
"having side effects on other handlers."
msgstr ""
#: ../../library/logging.rst:781
msgid ""
"Although filters are used primarily to filter records based on more "
"sophisticated criteria than levels, they get to see every record which is "
"processed by the handler or logger they're attached to: this can be useful "
"if you want to do things like counting how many records were processed by a "
"particular logger or handler, or adding, changing or removing attributes in "
"the :class:`LogRecord` being processed. Obviously changing the LogRecord "
"needs to be done with some care, but it does allow the injection of "
"contextual information into logs (see :ref:`filters-contextual`)."
msgstr ""
#: ../../library/logging.rst:794
msgid "LogRecord Objects"
msgstr "LogRecord 物件"
#: ../../library/logging.rst:796
msgid ""
":class:`LogRecord` instances are created automatically by the :class:"
"`Logger` every time something is logged, and can be created manually via :"
"func:`makeLogRecord` (for example, from a pickled event received over the "
"wire)."
msgstr ""
#: ../../library/logging.rst:804
msgid "Contains all the information pertinent to the event being logged."
msgstr ""
#: ../../library/logging.rst:806