-
Notifications
You must be signed in to change notification settings - Fork 395
/
Copy pathlogging.po
2344 lines (2094 loc) · 100 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
# Copyright (C) 2001-2020, Python Software Foundation
# This file is distributed under the same license as the Python package.
# Maintained by the python-doc-es workteam.
# docs-es@python.org /
# https://mail.python.org/mailman3/lists/docs-es.python.org/
# Check https://github.com/python/python-docs-es/blob/3.8/TRANSLATORS to get
# the list of volunteers
#
msgid ""
msgstr ""
"Project-Id-Version: Python 3.8\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-21 16:38-0300\n"
"PO-Revision-Date: 2023-10-24 17:50-0500\n"
"Last-Translator: Cristián Maureira-Fredes <cmaureirafredes@gmail.com>\n"
"Language: es_US\n"
"Language-Team: python-doc-es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.16.0\n"
#: ../Doc/howto/logging.rst:5
msgid "Logging HOWTO"
msgstr "HOWTO hacer registros (*Logging*)"
#: ../Doc/howto/logging.rst
msgid "Author"
msgstr "Autor"
#: ../Doc/howto/logging.rst:7
msgid "Vinay Sajip <vinay_sajip at red-dove dot com>"
msgstr "Vinay Sajip <vinay_sajip at red-dove dot com>"
#: ../Doc/howto/logging.rst:13
msgid ""
"This page contains tutorial information. For links to reference information "
"and a logging cookbook, please see :ref:`tutorial-ref-links`."
msgstr ""
"Esta página contiene información de tutorial. Para enlaces a información de "
"referencia y una guía de registro, consulte :ref:`tutorial-ref-links`."
#: ../Doc/howto/logging.rst:17
msgid "Basic Logging Tutorial"
msgstr "Tutorial básico de *logging*"
#: ../Doc/howto/logging.rst:19
msgid ""
"Logging is a means of tracking events that happen when some software runs. "
"The software's developer adds logging calls to their code to indicate that "
"certain events have occurred. An event is described by a descriptive message "
"which can optionally contain variable data (i.e. data that is potentially "
"different for each occurrence of the event). Events also have an importance "
"which the developer ascribes to the event; the importance can also be called "
"the *level* or *severity*."
msgstr ""
"*Logging* es un medio de rastrear los eventos que ocurren cuando se ejecuta "
"algún software. El desarrollador del software agrega llamadas de registro a "
"su código para indicar que ciertos eventos han ocurrido. Un evento se "
"describe mediante un mensaje descriptivo que puede contener opcionalmente "
"datos variables (es decir, datos que son potencialmente diferentes para cada "
"ocurrencia del evento). Los eventos también tienen una importancia que el "
"desarrollador atribuye al evento; la importancia también puede llamarse el "
"*nivel* o la *severidad*."
#: ../Doc/howto/logging.rst:28
msgid "When to use logging"
msgstr "Cuándo usar *logging*"
#: ../Doc/howto/logging.rst:30
msgid ""
"You can access logging functionality by creating a logger via ``logger = "
"getLogger(__name__)``, and then calling the logger's :meth:`~Logger.debug`, :"
"meth:`~Logger.info`, :meth:`~Logger.warning`, :meth:`~Logger.error` and :"
"meth:`~Logger.critical` methods. To determine when to use logging, and to "
"see which logger methods to use when, see the table below. It states, for "
"each of a set of common tasks, the best tool to use for that task."
msgstr ""
#: ../Doc/howto/logging.rst:38
msgid "Task you want to perform"
msgstr "La tarea que quieres realizar"
#: ../Doc/howto/logging.rst:38
msgid "The best tool for the task"
msgstr "La mejor herramienta para la tarea"
#: ../Doc/howto/logging.rst:40
msgid ""
"Display console output for ordinary usage of a command line script or program"
msgstr ""
"Mostrar salidas de la consola para el uso ordinario de un programa o guión "
"(script) de línea de comandos"
#: ../Doc/howto/logging.rst:40
msgid ":func:`print`"
msgstr ":func:`print`"
#: ../Doc/howto/logging.rst:44
msgid ""
"Report events that occur during normal operation of a program (e.g. for "
"status monitoring or fault investigation)"
msgstr ""
"Reportar eventos que ocurren durante el funcionamiento normal de un programa "
"(por ejemplo, para la supervisión del estado o la investigación de fallos)"
#: ../Doc/howto/logging.rst:44
#, fuzzy
msgid ""
"A logger's :meth:`~Logger.info` (or :meth:`~Logger.debug` method for very "
"detailed output for diagnostic purposes)"
msgstr ""
":func:`logging.info` (o :func:`logging.debug` para salidas de registro muy "
"detalladas con fines de diagnóstico)"
#: ../Doc/howto/logging.rst:49
msgid "Issue a warning regarding a particular runtime event"
msgstr ""
"Emitir una advertencia con respecto a un evento de tiempo de ejecución en "
"particular"
#: ../Doc/howto/logging.rst:49
msgid ""
":func:`warnings.warn` in library code if the issue is avoidable and the "
"client application should be modified to eliminate the warning"
msgstr ""
":func:`warnings.warn` en el código de la biblioteca si el problema es "
"evitable y la aplicación cliente debe ser modificada para eliminar la "
"advertencia"
#: ../Doc/howto/logging.rst:54
#, fuzzy
msgid ""
"A logger's :meth:`~Logger.warning` method if there is nothing the client "
"application can do about the situation, but the event should still be noted"
msgstr ""
":func:`logging.warning` si no hay nada que la aplicación cliente pueda hacer "
"sobre la situación, pero el evento debe ser anotado"
#: ../Doc/howto/logging.rst:60
msgid "Report an error regarding a particular runtime event"
msgstr ""
"Reportar un error con respecto a un evento particular al tiempo de ejecución"
#: ../Doc/howto/logging.rst:60
msgid "Raise an exception"
msgstr "Lanza una excepción"
#: ../Doc/howto/logging.rst:63
msgid ""
"Report suppression of an error without raising an exception (e.g. error "
"handler in a long-running server process)"
msgstr ""
"Reporta la supresión de un error sin invocar una excepción (por ejemplo, el "
"manejador de errores en un proceso de servidor de larga duración)"
#: ../Doc/howto/logging.rst:63
#, fuzzy
msgid ""
"A logger's :meth:`~Logger.error`, :meth:`~Logger.exception` or :meth:"
"`~Logger.critical` method as appropriate for the specific error and "
"application domain"
msgstr ""
":func:`logging.error`, :func:`logging.exception` o :func:`logging.critical` "
"según sea apropiado para el error específico y el dominio de la aplicación"
#: ../Doc/howto/logging.rst:70
#, fuzzy
msgid ""
"The logger methods are named after the level or severity of the events they "
"are used to track. The standard levels and their applicability are described "
"below (in increasing order of severity):"
msgstr ""
"Las funciones de registro se denominan según el nivel o la gravedad de los "
"eventos que se utilizan para rastrear. A continuación se describen los "
"niveles estándar y su aplicabilidad (en orden creciente de gravedad):"
#: ../Doc/howto/logging.rst:77 ../Doc/howto/logging.rst:875
msgid "Level"
msgstr "Nivel"
#: ../Doc/howto/logging.rst:77
msgid "When it's used"
msgstr "Cuando es usado"
#: ../Doc/howto/logging.rst:79 ../Doc/howto/logging.rst:885
msgid "``DEBUG``"
msgstr "``DEBUG``"
#: ../Doc/howto/logging.rst:79
msgid ""
"Detailed information, typically of interest only when diagnosing problems."
msgstr ""
"Información detallada, típicamente de interés sólo durante el diagnóstico de "
"problemas."
#: ../Doc/howto/logging.rst:82 ../Doc/howto/logging.rst:883
msgid "``INFO``"
msgstr "``INFO``"
#: ../Doc/howto/logging.rst:82
msgid "Confirmation that things are working as expected."
msgstr "Confirmación de que las cosas están funcionando como se esperaba."
#: ../Doc/howto/logging.rst:85 ../Doc/howto/logging.rst:881
msgid "``WARNING``"
msgstr "``WARNING``"
#: ../Doc/howto/logging.rst:85
msgid ""
"An indication that something unexpected happened, or indicative of some "
"problem in the near future (e.g. 'disk space low'). The software is still "
"working as expected."
msgstr ""
"Un indicio de que algo inesperado sucedió, o indicativo de algún problema en "
"el futuro cercano (por ejemplo, \"espacio de disco bajo\"). El software "
"sigue funcionando como se esperaba."
#: ../Doc/howto/logging.rst:90 ../Doc/howto/logging.rst:879
msgid "``ERROR``"
msgstr "``ERROR``"
#: ../Doc/howto/logging.rst:90
msgid ""
"Due to a more serious problem, the software has not been able to perform "
"some function."
msgstr ""
"Debido a un problema más grave, el software no ha sido capaz de realizar "
"alguna función."
#: ../Doc/howto/logging.rst:93 ../Doc/howto/logging.rst:877
msgid "``CRITICAL``"
msgstr "``CRITICAL``"
#: ../Doc/howto/logging.rst:93
msgid ""
"A serious error, indicating that the program itself may be unable to "
"continue running."
msgstr ""
"Un grave error, que indica que el programa en sí mismo puede ser incapaz de "
"seguir funcionando."
#: ../Doc/howto/logging.rst:97
#, fuzzy
msgid ""
"The default level is ``WARNING``, which means that only events of this "
"severity and higher will be tracked, unless the logging package is "
"configured to do otherwise."
msgstr ""
"El nivel por defecto es ``WARNING``, lo que significa que sólo los eventos "
"de este nivel y superiores serán rastreados, a menos que el paquete de "
"registro esté configurado para hacer lo contrario."
#: ../Doc/howto/logging.rst:100
msgid ""
"Events that are tracked can be handled in different ways. The simplest way "
"of handling tracked events is to print them to the console. Another common "
"way is to write them to a disk file."
msgstr ""
"Los eventos que se rastrean pueden ser manejados en diferentes maneras. La "
"forma más simple de manejar los eventos rastreados es imprimirlos en la "
"consola o terminal. Otra forma común es escribirlos en un archivo de disco."
#: ../Doc/howto/logging.rst:108
msgid "A simple example"
msgstr "Un simple ejemplo"
#: ../Doc/howto/logging.rst:110
msgid "A very simple example is::"
msgstr "Un ejemplo muy simple es::"
#: ../Doc/howto/logging.rst:112
msgid ""
"import logging\n"
"logging.warning('Watch out!') # will print a message to the console\n"
"logging.info('I told you so') # will not print anything"
msgstr ""
#: ../Doc/howto/logging.rst:116
msgid "If you type these lines into a script and run it, you'll see:"
msgstr "Si escribes estas líneas en un script y lo ejecutas, verás:"
#: ../Doc/howto/logging.rst:118
msgid "WARNING:root:Watch out!"
msgstr ""
#: ../Doc/howto/logging.rst:122
#, fuzzy
msgid ""
"printed out on the console. The ``INFO`` message doesn't appear because the "
"default level is ``WARNING``. The printed message includes the indication of "
"the level and the description of the event provided in the logging call, i."
"e. 'Watch out!'. The actual output can be formatted quite flexibly if you "
"need that; formatting options will also be explained later."
msgstr ""
"impreso en la consola. El mensaje ``INFO`` no aparece porque el nivel por "
"defecto es ``WARNING``. El mensaje impreso incluye la indicación del nivel y "
"la descripción del evento proporcionado en la llamada de registro, es decir, "
"\"¡Cuidado!\". No te preocupes por la parte de la ‘root’ por ahora: se "
"explicará más adelante. La salida real puede ser formateada con bastante "
"flexibilidad si lo necesita; las opciones de formato también se explicarán "
"más adelante."
#: ../Doc/howto/logging.rst:128
msgid ""
"Notice that in this example, we use functions directly on the ``logging`` "
"module, like ``logging.debug``, rather than creating a logger and calling "
"functions on it. These functions operation on the root logger, but can be "
"useful as they will call :func:`~logging.basicConfig` for you if it has not "
"been called yet, like in this example. In larger programs you'll usually "
"want to control the logging configuration explicitly however - so for that "
"reason as well as others, it's better to create loggers and call their "
"methods."
msgstr ""
#: ../Doc/howto/logging.rst:137
msgid "Logging to a file"
msgstr "Logging a un archivo"
#: ../Doc/howto/logging.rst:139
msgid ""
"A very common situation is that of recording logging events in a file, so "
"let's look at that next. Be sure to try the following in a newly started "
"Python interpreter, and don't just continue from the session described "
"above::"
msgstr ""
"Una situación muy común es la de registrar archivos de log, así que veamos "
"eso a continuación. Asegúrese de intentar lo siguiente en un intérprete de "
"Python recién iniciado, y no sólo continúe de la sesión descrita "
"anteriormente::"
#: ../Doc/howto/logging.rst:143
msgid ""
"import logging\n"
"logger = logging.getLogger(__name__)\n"
"logging.basicConfig(filename='example.log', encoding='utf-8', level=logging."
"DEBUG)\n"
"logger.debug('This message should go to the log file')\n"
"logger.info('So should this')\n"
"logger.warning('And this, too')\n"
"logger.error('And non-ASCII stuff, too, like Øresund and Malmö')"
msgstr ""
#: ../Doc/howto/logging.rst:151
msgid ""
"The *encoding* argument was added. In earlier Python versions, or if not "
"specified, the encoding used is the default value used by :func:`open`. "
"While not shown in the above example, an *errors* argument can also now be "
"passed, which determines how encoding errors are handled. For available "
"values and the default, see the documentation for :func:`open`."
msgstr ""
"Se agregó el argumento *encoding*. En versiones anteriores de Python, o si "
"no se especifica, la codificación utilizada es el valor predeterminado "
"utilizado por :func:`open`. Aunque no se muestra en el ejemplo anterior, "
"ahora también se puede pasar un argumento *errors*, que determina cómo se "
"manejan los errores de codificación. Para conocer los valores disponibles y "
"los predeterminados, consulte la documentación de :func:`open`."
#: ../Doc/howto/logging.rst:158
msgid ""
"And now if we open the file and look at what we have, we should find the log "
"messages:"
msgstr ""
"Y ahora si abrimos el archivo y miramos lo que tenemos, deberíamos encontrar "
"los mensajes de registro:"
#: ../Doc/howto/logging.rst:161
msgid ""
"DEBUG:__main__:This message should go to the log file\n"
"INFO:__main__:So should this\n"
"WARNING:__main__:And this, too\n"
"ERROR:__main__:And non-ASCII stuff, too, like Øresund and Malmö"
msgstr ""
#: ../Doc/howto/logging.rst:168
msgid ""
"This example also shows how you can set the logging level which acts as the "
"threshold for tracking. In this case, because we set the threshold to "
"``DEBUG``, all of the messages were printed."
msgstr ""
"Este ejemplo también muestra cómo se puede establecer el nivel de registro "
"que actúa como umbral para el rastreo. En este caso, como establecimos el "
"umbral en ``DEBUG``, todos los mensajes fueron impresos."
#: ../Doc/howto/logging.rst:172
msgid ""
"If you want to set the logging level from a command-line option such as:"
msgstr ""
"Si quieres establecer el nivel de registro desde una opción de línea de "
"comandos como:"
#: ../Doc/howto/logging.rst:174
#, fuzzy
msgid "--log=INFO"
msgstr "Flujo de Registro"
#: ../Doc/howto/logging.rst:178
msgid ""
"and you have the value of the parameter passed for ``--log`` in some "
"variable *loglevel*, you can use::"
msgstr ""
"y tienes el valor del parámetro pasado por ``--log`` en alguna variable "
"*loglevel*, puedes usar::"
#: ../Doc/howto/logging.rst:181
msgid "getattr(logging, loglevel.upper())"
msgstr ""
#: ../Doc/howto/logging.rst:183
msgid ""
"to get the value which you'll pass to :func:`basicConfig` via the *level* "
"argument. You may want to error check any user input value, perhaps as in "
"the following example::"
msgstr ""
"para obtener el valor que pasarás a :func:`basicConfig` mediante el "
"argumento *level*. Puede que quieras comprobar un error por cualquier valor "
"de entrada del usuario, quizás como en el siguiente ejemplo::"
#: ../Doc/howto/logging.rst:187
#, python-format
msgid ""
"# assuming loglevel is bound to the string value obtained from the\n"
"# command line argument. Convert to upper case to allow the user to\n"
"# specify --log=DEBUG or --log=debug\n"
"numeric_level = getattr(logging, loglevel.upper(), None)\n"
"if not isinstance(numeric_level, int):\n"
" raise ValueError('Invalid log level: %s' % loglevel)\n"
"logging.basicConfig(level=numeric_level, ...)"
msgstr ""
#: ../Doc/howto/logging.rst:195
msgid ""
"The call to :func:`basicConfig` should come *before* any calls to a logger's "
"methods such as :meth:`~Logger.debug`, :meth:`~Logger.info`, etc. Otherwise, "
"that logging event may not be handled in the desired manner."
msgstr ""
#: ../Doc/howto/logging.rst:199
msgid ""
"If you run the above script several times, the messages from successive runs "
"are appended to the file *example.log*. If you want each run to start "
"afresh, not remembering the messages from earlier runs, you can specify the "
"*filemode* argument, by changing the call in the above example to::"
msgstr ""
"Si ejecutas el script anterior varias veces, los mensajes de las ejecuciones "
"sucesivas se añaden al archivo *example.log*. Si quieres que cada ejecución "
"se inicie de nuevo, sin recordar los mensajes de ejecuciones anteriores, "
"puedes especificar el argumento *filemode*, cambiando la llamada en el "
"ejemplo anterior a::"
#: ../Doc/howto/logging.rst:204
msgid ""
"logging.basicConfig(filename='example.log', filemode='w', level=logging."
"DEBUG)"
msgstr ""
#: ../Doc/howto/logging.rst:206
msgid ""
"The output will be the same as before, but the log file is no longer "
"appended to, so the messages from earlier runs are lost."
msgstr ""
"La impresión será la misma que antes, pero el archivo de registro ya no se "
"adjunta, por lo que los mensajes de las ejecuciones anteriores se pierden."
#: ../Doc/howto/logging.rst:211
msgid "Logging variable data"
msgstr "Registrar datos de variables"
#: ../Doc/howto/logging.rst:213
msgid ""
"To log variable data, use a format string for the event description message "
"and append the variable data as arguments. For example::"
msgstr ""
"Para registrar los datos de variables, utilice una cadena de formato para el "
"mensaje de descripción del evento y añada los datos variables como "
"argumentos. Por ejemplo::"
#: ../Doc/howto/logging.rst:216
#, python-format
msgid ""
"import logging\n"
"logging.warning('%s before you %s', 'Look', 'leap!')"
msgstr ""
#: ../Doc/howto/logging.rst:219
msgid "will display:"
msgstr "se mostrará:"
#: ../Doc/howto/logging.rst:221
msgid "WARNING:root:Look before you leap!"
msgstr ""
#: ../Doc/howto/logging.rst:225
#, python-format
msgid ""
"As you can see, merging of variable data into the event description message "
"uses the old, %-style of string formatting. This is for backwards "
"compatibility: the logging package pre-dates newer formatting options such "
"as :meth:`str.format` and :class:`string.Template`. These newer formatting "
"options *are* supported, but exploring them is outside the scope of this "
"tutorial: see :ref:`formatting-styles` for more information."
msgstr ""
"Como puede ver, la combinación de datos de variables en el mensaje de "
"descripción del evento utiliza el antiguo estilo de formato de cadena con el "
"signo de porcentaje (%). Esto se hace por razones de compatibilidad con "
"versiones anteriores: el paquete de registro existe desde antes de las "
"opciones de formato más nuevas como :meth:`str.format` y :class:`string."
"Template`. Estas opciones de formato más nuevas *son* soportadas, pero "
"explorarlas está fuera del alcance de este tutorial: consulte :ref:"
"`formatting-styles` para obtener más información."
#: ../Doc/howto/logging.rst:234
msgid "Changing the format of displayed messages"
msgstr "Cambiar el formato de los mensajes mostrados"
#: ../Doc/howto/logging.rst:236
msgid ""
"To change the format which is used to display messages, you need to specify "
"the format you want to use::"
msgstr ""
"Para cambiar el formato que se utiliza para visualizar los mensajes, es "
"necesario especificar el formato que se desea utilizar::"
#: ../Doc/howto/logging.rst:239
#, python-format
msgid ""
"import logging\n"
"logging.basicConfig(format='%(levelname)s:%(message)s', level=logging."
"DEBUG)\n"
"logging.debug('This message should appear on the console')\n"
"logging.info('So should this')\n"
"logging.warning('And this, too')"
msgstr ""
#: ../Doc/howto/logging.rst:245
msgid "which would print:"
msgstr "que se imprimirá:"
#: ../Doc/howto/logging.rst:247
msgid ""
"DEBUG:This message should appear on the console\n"
"INFO:So should this\n"
"WARNING:And this, too"
msgstr ""
#: ../Doc/howto/logging.rst:253
msgid ""
"Notice that the 'root' which appeared in earlier examples has disappeared. "
"For a full set of things that can appear in format strings, you can refer to "
"the documentation for :ref:`logrecord-attributes`, but for simple usage, you "
"just need the *levelname* (severity), *message* (event description, "
"including variable data) and perhaps to display when the event occurred. "
"This is described in the next section."
msgstr ""
"Noten que la ‘root’ que aparecía en los ejemplos anteriores ha desaparecido. "
"Para un conjunto completo de cosas que pueden aparecer en formato de "
"cadenas, puede consultar la documentación de :ref:`logrecord-attributes`, "
"pero para un uso sencillo, sólo necesita el *levelname* (gravedad), "
"*message* (descripción del evento, incluyendo los datos variables) y tal vez "
"mostrar cuándo ocurrió el evento. Esto se describe en la siguiente sección."
#: ../Doc/howto/logging.rst:262
msgid "Displaying the date/time in messages"
msgstr "Visualización de la fecha/hora en los mensajes"
#: ../Doc/howto/logging.rst:264
#, python-format
msgid ""
"To display the date and time of an event, you would place '%(asctime)s' in "
"your format string::"
msgstr ""
"Para mostrar la fecha y la hora de un evento, usted colocaría '%(asctime)s' "
"en su cadena de formato::"
#: ../Doc/howto/logging.rst:267
#, python-format
msgid ""
"import logging\n"
"logging.basicConfig(format='%(asctime)s %(message)s')\n"
"logging.warning('is when this event was logged.')"
msgstr ""
#: ../Doc/howto/logging.rst:271
msgid "which should print something like this:"
msgstr "que debería imprimir algo como esto:"
#: ../Doc/howto/logging.rst:273
msgid "2010-12-12 11:41:42,612 is when this event was logged."
msgstr ""
#: ../Doc/howto/logging.rst:277
msgid ""
"The default format for date/time display (shown above) is like ISO8601 or :"
"rfc:`3339`. If you need more control over the formatting of the date/time, "
"provide a *datefmt* argument to ``basicConfig``, as in this example::"
msgstr ""
"El formato por defecto para la visualización de la fecha/hora (mostrado "
"arriba) es como ISO8601 o :rfc:`3339`. Si necesita más control sobre el "
"formato de la fecha/hora, proporcione un argumento *datefmt* a "
"``basicConfig``, como en este ejemplo::"
#: ../Doc/howto/logging.rst:281
#, python-format
msgid ""
"import logging\n"
"logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:"
"%M:%S %p')\n"
"logging.warning('is when this event was logged.')"
msgstr ""
#: ../Doc/howto/logging.rst:285
msgid "which would display something like this:"
msgstr "que mostraría algo como esto:"
#: ../Doc/howto/logging.rst:287
msgid "12/12/2010 11:46:36 AM is when this event was logged."
msgstr ""
#: ../Doc/howto/logging.rst:291
msgid ""
"The format of the *datefmt* argument is the same as supported by :func:`time."
"strftime`."
msgstr ""
"El formato del argumento *datefmt* es el mismo que el soportado por :func:"
"`time.strftime`."
#: ../Doc/howto/logging.rst:296
msgid "Next Steps"
msgstr "Próximos pasos"
#: ../Doc/howto/logging.rst:298
msgid ""
"That concludes the basic tutorial. It should be enough to get you up and "
"running with logging. There's a lot more that the logging package offers, "
"but to get the best out of it, you'll need to invest a little more of your "
"time in reading the following sections. If you're ready for that, grab some "
"of your favourite beverage and carry on."
msgstr ""
"Eso concluye el tutorial básico. Debería ser suficiente para ponerte en "
"marcha con el registro. Hay mucho más que el paquete de registro ofrece, "
"pero para obtener lo mejor de él, tendrá que invertir un poco más de su "
"tiempo en la lectura de las siguientes secciones. Si estás listo para eso, "
"toma un poco de tu bebida favorita y sigue adelante."
#: ../Doc/howto/logging.rst:304
msgid ""
"If your logging needs are simple, then use the above examples to incorporate "
"logging into your own scripts, and if you run into problems or don't "
"understand something, please post a question on the comp.lang.python Usenet "
"group (available at https://groups.google.com/g/comp.lang.python) and you "
"should receive help before too long."
msgstr ""
"Si sus necesidades de registro son sencillas, utilice los ejemplos previos "
"para incorporar el registro en sus propios scripts, y si tiene problemas o "
"no entiende algo, por favor publique una pregunta en el grupo Usenet de comp."
"lang.python (disponible en https://groups.google.com/g/comp.lang.python) y "
"debería recibir ayuda antes de que transcurra demasiado tiempo."
#: ../Doc/howto/logging.rst:310
msgid ""
"Still here? You can carry on reading the next few sections, which provide a "
"slightly more advanced/in-depth tutorial than the basic one above. After "
"that, you can take a look at the :ref:`logging-cookbook`."
msgstr ""
"¿Todavía esta aquí? Puedes seguir leyendo las siguientes secciones, que "
"proporcionan un tutorial un poco más avanzado y profundo que el básico de "
"arriba. Después de eso, puedes echar un vistazo al :ref:`logging-cookbook`."
#: ../Doc/howto/logging.rst:318
msgid "Advanced Logging Tutorial"
msgstr "Tutorial de registro avanzado"
#: ../Doc/howto/logging.rst:320
msgid ""
"The logging library takes a modular approach and offers several categories "
"of components: loggers, handlers, filters, and formatters."
msgstr ""
"La biblioteca de logging adopta un enfoque modular y ofrece varias "
"categorías de componentes: registradores, gestores, filtros y formateadores."
#: ../Doc/howto/logging.rst:323
msgid "Loggers expose the interface that application code directly uses."
msgstr ""
"Los registradores exponen la interfaz que el código de la aplicación utiliza "
"directamente."
#: ../Doc/howto/logging.rst:324
msgid ""
"Handlers send the log records (created by loggers) to the appropriate "
"destination."
msgstr ""
"Los gestores envían los registros de log (creados por los registradores) al "
"destino apropiado."
#: ../Doc/howto/logging.rst:326
msgid ""
"Filters provide a finer grained facility for determining which log records "
"to output."
msgstr ""
"Los filtros proporcionan una instalación de grano más fino para determinar "
"qué registros de log se deben producir."
#: ../Doc/howto/logging.rst:328
msgid "Formatters specify the layout of log records in the final output."
msgstr ""
"Los formatos especifican la disposición de los archivos de log en el "
"resultado final."
#: ../Doc/howto/logging.rst:330
msgid ""
"Log event information is passed between loggers, handlers, filters and "
"formatters in a :class:`LogRecord` instance."
msgstr ""
"La información de los eventos de registro se pasa entre los registradores, "
"gestores, filtros y formateadores en una instancia :class:`LogRecord`."
#: ../Doc/howto/logging.rst:333
msgid ""
"Logging is performed by calling methods on instances of the :class:`Logger` "
"class (hereafter called :dfn:`loggers`). Each instance has a name, and they "
"are conceptually arranged in a namespace hierarchy using dots (periods) as "
"separators. For example, a logger named 'scan' is the parent of loggers "
"'scan.text', 'scan.html' and 'scan.pdf'. Logger names can be anything you "
"want, and indicate the area of an application in which a logged message "
"originates."
msgstr ""
"El registro se realiza llamando a métodos en instancias de la clase :class:"
"`Logger` (de aquí en adelante llamada :dfn:`loggers`). Cada instancia tiene "
"un nombre, y se organizan conceptualmente en una jerarquía de espacios de "
"nombres utilizando puntos (puntos) como separadores. Por ejemplo, un "
"registrador llamado 'scan' es el padre de los registradores 'scan.text', "
"'scan.html' y 'scan.pdf'. Los nombres de los registradores pueden ser "
"cualquier cosa que se desee, e indican el área de una aplicación en la que "
"se origina un mensaje registrado."
#: ../Doc/howto/logging.rst:340
msgid ""
"A good convention to use when naming loggers is to use a module-level "
"logger, in each module which uses logging, named as follows::"
msgstr ""
"Una buena convención que se puede utilizar para nombrar a los registradores "
"es utilizar un registrador a nivel de módulo, en cada módulo que utilice el "
"registro, llamado de la siguiente manera::"
#: ../Doc/howto/logging.rst:343
msgid "logger = logging.getLogger(__name__)"
msgstr ""
#: ../Doc/howto/logging.rst:345
msgid ""
"This means that logger names track the package/module hierarchy, and it's "
"intuitively obvious where events are logged just from the logger name."
msgstr ""
"Esto significa que los nombres de los registradores rastrean la jerarquía de "
"paquetes/módulos, y es intuitivamente obvio donde se registran los eventos "
"sólo a partir del nombre del registrador."
#: ../Doc/howto/logging.rst:348
msgid ""
"The root of the hierarchy of loggers is called the root logger. That's the "
"logger used by the functions :func:`debug`, :func:`info`, :func:`warning`, :"
"func:`error` and :func:`critical`, which just call the same-named method of "
"the root logger. The functions and the methods have the same signatures. The "
"root logger's name is printed as 'root' in the logged output."
msgstr ""
"La raíz de la jerarquía de los registradores se llama root *logger*. Ese es "
"el registrador usado por las funciones :func:`debug`, :func:`info`, :func:"
"`warning`, :func:`error` y :func:`critícal`, que sólo llaman al mismo método "
"del registrador raíz. Las funciones y los métodos tienen las mismas firmas. "
"El nombre del root *logger* se imprime como ‘root’ en la salida registrada."
#: ../Doc/howto/logging.rst:354
msgid ""
"It is, of course, possible to log messages to different destinations. "
"Support is included in the package for writing log messages to files, HTTP "
"GET/POST locations, email via SMTP, generic sockets, queues, or OS-specific "
"logging mechanisms such as syslog or the Windows NT event log. Destinations "
"are served by :dfn:`handler` classes. You can create your own log "
"destination class if you have special requirements not met by any of the "
"built-in handler classes."
msgstr ""
"Por supuesto, es posible registrar mensajes a diferentes destinos. El "
"paquete incluye soporte para escribir mensajes de registro en archivos, "
"ubicaciones HTTP GET/POST, correo electrónico a través de SMTP, sockets "
"genéricos, colas o mecanismos de registro específicos del sistema operativo "
"como syslog o el registro de eventos de Windows NT. Los destinos son "
"servidos por clases :dfn:`handler`. Puedes crear tu propia clase de destino "
"de registro si tienes requisitos especiales que no se cumplen con ninguna de "
"las clases de gestor incorporadas."
#: ../Doc/howto/logging.rst:361
msgid ""
"By default, no destination is set for any logging messages. You can specify "
"a destination (such as console or file) by using :func:`basicConfig` as in "
"the tutorial examples. If you call the functions :func:`debug`, :func:"
"`info`, :func:`warning`, :func:`error` and :func:`critical`, they will check "
"to see if no destination is set; and if one is not set, they will set a "
"destination of the console (``sys.stderr``) and a default format for the "
"displayed message before delegating to the root logger to do the actual "
"message output."
msgstr ""
"Por defecto, no se establece ningún destino para los mensajes de registro. "
"Puede especificar un destino (como consola o archivo) usando :func:"
"`basicConfig` como en los ejemplos del tutorial. Si llama a las funciones :"
"func:`debug`, :func:`info`, :func:`warning`, :func:`error` y :func:"
"`critical`, ellas comprobarán si no hay ningún destino establecido; y si no "
"hay ninguno establecido, establecerán un destino de la consola (``sys."
"stderr``) y un formato por defecto para el mensaje mostrado antes de delegar "
"en el registrador root para hacer la salida real del mensaje."
#: ../Doc/howto/logging.rst:369
msgid "The default format set by :func:`basicConfig` for messages is:"
msgstr ""
"El formato por defecto establecido por :func:`basicConfig` para los mensajes "
"es:"
#: ../Doc/howto/logging.rst:371
msgid "severity:logger name:message"
msgstr ""
#: ../Doc/howto/logging.rst:375
msgid ""
"You can change this by passing a format string to :func:`basicConfig` with "
"the *format* keyword argument. For all options regarding how a format string "
"is constructed, see :ref:`formatter-objects`."
msgstr ""
"Puedes cambiar esto pasando una cadena de formato a :func:`basicConfig` con "
"el argumento de la palabra clave *format*. Para todas las opciones relativas "
"a cómo se construye una cadena de formato, ver :ref:`formatter-objects`."
#: ../Doc/howto/logging.rst:380
msgid "Logging Flow"
msgstr "Flujo de Registro"
#: ../Doc/howto/logging.rst:382
msgid ""
"The flow of log event information in loggers and handlers is illustrated in "
"the following diagram."
msgstr ""
"En el siguiente diagrama se ilustra el flujo de información de los eventos "
"de registro en los registradores y gestores."
#: ../Doc/howto/logging.rst:433
msgid "Loggers"
msgstr "Registradores"
#: ../Doc/howto/logging.rst:435
msgid ""
":class:`Logger` objects have a threefold job. First, they expose several "
"methods to application code so that applications can log messages at "
"runtime. Second, logger objects determine which log messages to act upon "
"based upon severity (the default filtering facility) or filter objects. "
"Third, logger objects pass along relevant log messages to all interested log "
"handlers."
msgstr ""
"Los objetos de :class:`Logger` tienen un trabajo triple. Primero, exponen "
"varios métodos al código de la aplicación para que las aplicaciones puedan "
"registrar mensajes en tiempo de ejecución. Segundo, los objetos *logger* "
"determinan sobre qué mensajes de registro actuar en base de la severidad (la "
"facilidad de filtrado por defecto) o los objetos de filtro. Tercero, los "
"objetos registradores pasan los mensajes de registro relevantes a todos los "
"manejadores de registro interesados."
#: ../Doc/howto/logging.rst:441
msgid ""
"The most widely used methods on logger objects fall into two categories: "
"configuration and message sending."
msgstr ""
"Los métodos más utilizados en los objetos de registro se dividen en dos "
"categorías: configuración y envío de mensajes."
#: ../Doc/howto/logging.rst:444
msgid "These are the most common configuration methods:"
msgstr "Estos son los métodos de configuración más comunes:"
#: ../Doc/howto/logging.rst:446
msgid ""
":meth:`Logger.setLevel` specifies the lowest-severity log message a logger "
"will handle, where debug is the lowest built-in severity level and critical "
"is the highest built-in severity. For example, if the severity level is "
"INFO, the logger will handle only INFO, WARNING, ERROR, and CRITICAL "
"messages and will ignore DEBUG messages."
msgstr ""
":meth:`Logger.setLevel` especifica el mensaje de registro de menor gravedad "
"que un registrador manejará, donde debug es el nivel de gravedad incorporado "
"más bajo y *critical* es el de mayor gravedad incorporado. Por ejemplo, si "
"el nivel de severidad es INFO, el registrador sólo manejará los mensajes "
"INFO, WARNING, ERROR y CRITICAL e ignorará los mensajes DEBUG."
#: ../Doc/howto/logging.rst:452
msgid ""
":meth:`Logger.addHandler` and :meth:`Logger.removeHandler` add and remove "
"handler objects from the logger object. Handlers are covered in more detail "
"in :ref:`handler-basic`."
msgstr ""
":meth:`Logger.addHandler` y :meth:`Logger.removeHandler` agregan y quitan "
"los objetos *handler* del objeto *logger*. Los manejadores (*handlers*) se "
"tratan con más detalle en :ref:`handler-basic`."
#: ../Doc/howto/logging.rst:456
msgid ""
":meth:`Logger.addFilter` and :meth:`Logger.removeFilter` add and remove "
"filter objects from the logger object. Filters are covered in more detail "
"in :ref:`filter`."
msgstr ""
":meth:`Logger.addFilter` y :meth:`Logger.removeFilter` agregan y quitan los "
"objetos de filtro del objeto logger. Los filtros se tratan con más detalle "
"en :ref:`filter`."
#: ../Doc/howto/logging.rst:460
msgid ""
"You don't need to always call these methods on every logger you create. See "
"the last two paragraphs in this section."
msgstr ""
"No es necesario que siempre llames a estos métodos en cada registrador que "
"crees. Vea los dos últimos párrafos de esta sección."
#: ../Doc/howto/logging.rst:463
msgid ""
"With the logger object configured, the following methods create log messages:"
msgstr ""
"Con el objeto *logger* configurado, los siguientes métodos crean mensajes de "
"log:"
#: ../Doc/howto/logging.rst:465
#, python-format
msgid ""
":meth:`Logger.debug`, :meth:`Logger.info`, :meth:`Logger.warning`, :meth:"
"`Logger.error`, and :meth:`Logger.critical` all create log records with a "
"message and a level that corresponds to their respective method names. The "
"message is actually a format string, which may contain the standard string "
"substitution syntax of ``%s``, ``%d``, ``%f``, and so on. The rest of their "
"arguments is a list of objects that correspond with the substitution fields "
"in the message. With regard to ``**kwargs``, the logging methods care only "
"about a keyword of ``exc_info`` and use it to determine whether to log "
"exception information."
msgstr ""
":meth:`Logger.debug`, :meth:`Logger.info`, :meth:`Logger.warning`, :meth:"
"`Logger.error`, y :meth:`Logger.critical` todos crean registros de registro "
"con un mensaje y un nivel que corresponde a sus respectivos nombres de "
"método. El mensaje es en realidad una cadena de formato, que puede contener "
"la sintaxis estándar de sustitución de cadenas de ``%s``, ``%d``, ``%f``, y "
"así sucesivamente. El resto de sus argumentos es una lista de objetos que "
"se corresponden con los campos de sustitución del mensaje. Con respecto a "
"``**kwargs``, los métodos de registro sólo se preocupan por una palabra "
"clave de ``exc_info`` y la usan para determinar si registran información de "
"excepción."
#: ../Doc/howto/logging.rst:475
msgid ""
":meth:`Logger.exception` creates a log message similar to :meth:`Logger."
"error`. The difference is that :meth:`Logger.exception` dumps a stack trace "
"along with it. Call this method only from an exception handler."
msgstr ""
":meth:`Logger.exception` crea un mensaje de registro similar a :meth:`Logger."
"error`. La diferencia es que :meth:`Logger.exception` vuelca un rastro de "
"pila junto con él. Llama a este método sólo desde un manejador de "
"excepciones."
#: ../Doc/howto/logging.rst:479
msgid ""
":meth:`Logger.log` takes a log level as an explicit argument. This is a "
"little more verbose for logging messages than using the log level "
"convenience methods listed above, but this is how to log at custom log "
"levels."
msgstr ""
":meth:`Logger.log` toma un nivel de log como argumento explícito. Esto es "
"un poco más verboso para el registro de mensajes que usar los métodos de "
"conveniencia de nivel de registro listados arriba, pero así es como se "
"registra en niveles de registro personalizados."
#: ../Doc/howto/logging.rst:483
msgid ""
":func:`getLogger` returns a reference to a logger instance with the "
"specified name if it is provided, or ``root`` if not. The names are period-"
"separated hierarchical structures. Multiple calls to :func:`getLogger` with "
"the same name will return a reference to the same logger object. 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``."
msgstr ""
":func:`getLogger` retorna una referencia a una instancia de *logger* con el "
"nombre especificado si se proporciona, o ``root`` si no. Los nombres son "
"estructuras jerárquicas separadas por períodos. Múltiples llamadas a :func:"
"`getLogger` con el mismo nombre retornarán una referencia al mismo objeto "
"*logger*. Los *loggers* que están más abajo en la lista jerárquica son "
"hijos de los *loggers* que están más arriba en la lista. Por ejemplo, dado "
"un *logger* con un nombre de ``foo``, los *loggers* con nombres de ``foo."
"bar``, ``foo.bar.baz``, y ``foo.bam`` son todos descendientes de ``foo``."
#: ../Doc/howto/logging.rst:491
msgid ""
"Loggers have a concept of *effective level*. If a level is not explicitly "
"set on a logger, the level of its parent is used instead as its effective "
"level. If the parent has no explicit level set, *its* parent is examined, "
"and so on - all ancestors are searched until an explicitly set level is "
"found. The root logger always has an explicit level set (``WARNING`` by "
"default). When deciding whether to process an event, the effective level of "