Skip to content

Traduccion howto logging cookbook #1665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 8, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 63 additions & 18 deletions howto/logging-cookbook.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ msgstr ""
"Project-Id-Version: Python 3.8\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-16 21:42+0200\n"
"PO-Revision-Date: 2021-08-04 20:41+0200\n"
"PO-Revision-Date: 2021-11-26 15:32+0100\n"
"Last-Translator: Cristián Maureira-Fredes <cmaureirafredes@gmail.com>\n"
"Language: es\n"
"Language-Team: python-doc-es\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\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.9.1\n"
"X-Generator: Poedit 3.0\n"

#: ../Doc/howto/logging-cookbook.rst:5
msgid "Logging Cookbook"
Expand Down Expand Up @@ -224,13 +225,12 @@ msgid "Dealing with handlers that block"
msgstr "Tratar con gestores que bloquean"

#: ../Doc/howto/logging-cookbook.rst:334
#, fuzzy
msgid ""
"Sometimes you have to get your logging handlers to do their work without "
"blocking the thread you're logging from. This is common in web applications, "
"though of course it also occurs in other scenarios."
msgstr ""
"A veces tiene que hacer que sus gestores de logging hagan su trabajo sin "
"A veces tiene que hacer que sus manejadores de registro hagan su trabajo sin "
"bloquear el hilo desde el que está iniciando sesión. Esto es común en las "
"aplicaciones web, aunque, por supuesto, también ocurre en otros escenarios."

Expand Down Expand Up @@ -762,7 +762,6 @@ msgid "Use of alternative formatting styles"
msgstr "Uso de estilos de formato alternativos"

#: ../Doc/howto/logging-cookbook.rst:1049
#, python-format
msgid ""
"When logging was added to the Python standard library, the only way of "
"formatting messages with variable content was to use the %-formatting "
Expand Down Expand Up @@ -800,7 +799,6 @@ msgstr ""
"una sesión de consola de ejemplo para mostrar las posibilidades:"

#: ../Doc/howto/logging-cookbook.rst:1089
#, python-format
msgid ""
"Note that the formatting of logging messages for final output to logs is "
"completely independent of how an individual logging message is constructed. "
Expand All @@ -811,9 +809,7 @@ msgstr ""
"individual. Para eso todavía puede usar el formateo \"%\", como se muestra "
"aquí:"

# No entiendo este bloque en inglés ni en español :P
#: ../Doc/howto/logging-cookbook.rst:1097
#, python-format
msgid ""
"Logging calls (``logger.debug()``, ``logger.info()`` etc.) only take "
"positional parameters for the actual logging message itself, with keyword "
Expand Down Expand Up @@ -858,7 +854,6 @@ msgstr ""
"siguientes dos clases::"

#: ../Doc/howto/logging-cookbook.rst:1134
#, python-format
msgid ""
"Either of these can be used in place of a format string, to allow {}- or $-"
"formatting to be used to build the actual \"message\" part which appears in "
Expand Down Expand Up @@ -1266,8 +1261,6 @@ msgstr ""
msgid "Inserting a BOM into messages sent to a SysLogHandler"
msgstr "Insertar BOM en mensajes enviados a SysLogHandler"

# se hizo un cambio para que no ocurriera el error de :rfc:`...` que no
# comienza por número.
#: ../Doc/howto/logging-cookbook.rst:1689
msgid ""
":rfc:`5424` requires that a Unicode message be sent to a syslog daemon as a "
Expand Down Expand Up @@ -1537,7 +1530,6 @@ msgstr ""
"cómo se construye un mensaje de logging individual."

#: ../Doc/howto/logging-cookbook.rst:1970
#, python-format
msgid ""
"Logging calls (:meth:`~Logger.debug`, :meth:`~Logger.info` etc.) only take "
"positional parameters for the actual logging message itself, with keyword "
Expand Down Expand Up @@ -1566,7 +1558,6 @@ msgstr ""
"el código existente utilizarán cadenas de caracteres formato %."

#: ../Doc/howto/logging-cookbook.rst:1982
#, python-format
msgid ""
"There have been suggestions to associate format styles with specific "
"loggers, but that approach also runs into backward compatibility problems "
Expand Down Expand Up @@ -1595,7 +1586,6 @@ msgid "Using LogRecord factories"
msgstr "Uso de fábricas de LogRecord"

#: ../Doc/howto/logging-cookbook.rst:1995
#, python-format
msgid ""
"In Python 3.2, along with the :class:`~logging.Formatter` changes mentioned "
"above, the logging package gained the ability to allow users to set their "
Expand Down Expand Up @@ -1652,7 +1642,6 @@ msgstr ""
"formato real. Considere las siguientes dos clases:"

#: ../Doc/howto/logging-cookbook.rst:2038
#, python-format
msgid ""
"Either of these can be used in place of a format string, to allow {}- or $-"
"formatting to be used to build the actual \"message\" part which appears in "
Expand Down Expand Up @@ -2262,7 +2251,7 @@ msgstr ""

#: ../Doc/howto/logging-cookbook.rst:2987
msgid "Patterns to avoid"
msgstr ""
msgstr "Patrones para evitar"

#: ../Doc/howto/logging-cookbook.rst:2989
msgid ""
Expand All @@ -2271,10 +2260,15 @@ msgid ""
"which are *unhelpful*, and which should therefore be avoided in most cases. "
"The following sections are in no particular order."
msgstr ""
"Aunque las secciones anteriores han descrito formas de hacer las cosas que "
"podría necesitar hacer o con las que tratar, vale la pena mencionar algunos "
"patrones de uso que son *inútiles* y que, por lo tanto, deben evitarse en la "
"mayoría de los casos. Las siguientes secciones no están en ningún orden en "
"particular."

#: ../Doc/howto/logging-cookbook.rst:2996
msgid "Opening the same log file multiple times"
msgstr ""
msgstr "Abrir el mismo archivo de registro varias veces"

#: ../Doc/howto/logging-cookbook.rst:2998
msgid ""
Expand All @@ -2283,31 +2277,45 @@ msgid ""
"However, on POSIX platforms you'll not get any errors if you open the same "
"file multiple times. This could be done accidentally, for example by:"
msgstr ""
"En Windows, por lo general, no podrá abrir el mismo archivo varias veces, ya "
"que esto generará un error de \"otro proceso está usando el archivo\". Sin "
"embargo, en las plataformas POSIX no obtendrá ningún error si abre el mismo "
"archivo varias veces. Esto podría hacerse accidentalmente, por ejemplo:"

#: ../Doc/howto/logging-cookbook.rst:3003
msgid ""
"Adding a file handler more than once which references the same file (e.g. by "
"a copy/paste/forget-to-change error)."
msgstr ""
"Agregar un controlador de archivos más de una vez que hace referencia al "
"mismo archivo (por ejemplo, mediante un error de copiar/pegar/olvidar-"
"cambiar)."

#: ../Doc/howto/logging-cookbook.rst:3006
msgid ""
"Opening two files that look different, as they have different names, but are "
"the same because one is a symbolic link to the other."
msgstr ""
"Abrir dos archivos que se ven diferentes, ya que tienen diferentes nombres, "
"pero son iguales porque uno es un enlace simbólico al otro."

#: ../Doc/howto/logging-cookbook.rst:3009
msgid ""
"Forking a process, following which both parent and child have a reference to "
"the same file. This might be through use of the :mod:`multiprocessing` "
"module, for example."
msgstr ""
"Bifurcar un proceso, después del cual tanto el padre como el hijo tienen una "
"referencia al mismo archivo. Esto podría ser mediante el uso del módulo :mod:"
"`multiprocessing`, por ejemplo."

#: ../Doc/howto/logging-cookbook.rst:3013
msgid ""
"Opening a file multiple times might *appear* to work most of the time, but "
"can lead to a number of problems in practice:"
msgstr ""
"Abrir un archivo varias veces puede *parecer* que funciona la mayor parte "
"del tiempo, pero puede dar lugar a una serie de problemas en la práctica:"

#: ../Doc/howto/logging-cookbook.rst:3016
msgid ""
Expand All @@ -2317,6 +2325,12 @@ msgid ""
"if concurrent writes are attempted by two different threads using two "
"different handler instances which happen to point to the same file."
msgstr ""
"La salida del registro se puede distorsionar porque varios subprocesos o "
"procesos intentan escribir en el mismo archivo. Aunque el registro protege "
"contra el uso simultáneo de la misma instancia de controlador por varios "
"subprocesos, no existe tal protección si dos subprocesos diferentes intentan "
"escrituras simultáneas utilizando dos instancias de controlador diferentes "
"que apunten al mismo archivo."

#: ../Doc/howto/logging-cookbook.rst:3022
msgid ""
Expand All @@ -2325,16 +2339,24 @@ msgid ""
"confusion and wasted debugging time - log entries end up in unexpected "
"places, or are lost altogether."
msgstr ""
"Un intento de eliminar un archivo (por ejemplo, durante la rotación de "
"archivos) falla silenciosamente, porque hay otra referencia que apunta a él. "
"Esto puede generar confusión y una pérdida de tiempo de depuración: las "
"entradas del registro terminan en lugares inesperados o se pierden por "
"completo."

#: ../Doc/howto/logging-cookbook.rst:3027
msgid ""
"Use the techniques outlined in :ref:`multiple-processes` to circumvent such "
"issues."
msgstr ""
"Utilice las técnicas descritas en :ref:`multiple-processes` para evitar "
"estos problemas."

#: ../Doc/howto/logging-cookbook.rst:3031
msgid "Using loggers as attributes in a class or passing them as parameters"
msgstr ""
"Usar registradores como atributos en una clase o pasarlos como parámetros"

#: ../Doc/howto/logging-cookbook.rst:3033
msgid ""
Expand All @@ -2346,11 +2368,21 @@ msgid ""
"attributes. However, this pattern doesn't make sense in Python, where the "
"module (and not the class) is the unit of software decomposition."
msgstr ""
"Si bien puede haber casos inusuales en los que deba hacer esto, en general "
"no tiene sentido porque los registradores son singletons. El código siempre "
"puede acceder a una instancia de registrador dada por su nombre usando "
"``logging.getLogger(name)``, por lo que pasar instancias y mantenerlas como "
"atributos de instancia no tiene sentido. Tenga en cuenta que en otros "
"lenguajes como Java y C#, los registradores suelen ser atributos de clase "
"estáticos. Sin embargo, este patrón no tiene sentido en Python, donde el "
"módulo (y no la clase) es la unidad de descomposición del software."

#: ../Doc/howto/logging-cookbook.rst:3043
msgid ""
"Adding handlers other than :class:`NullHandler` to a logger in a library"
msgstr ""
"Agregar controladores distintos a :class:`NullHandler` a un registrador en "
"una biblioteca"

#: ../Doc/howto/logging-cookbook.rst:3045
msgid ""
Expand All @@ -2359,10 +2391,15 @@ msgid ""
"you are maintaining a library, ensure that you don't add handlers to any of "
"your loggers other than a :class:`~logging.NullHandler` instance."
msgstr ""
"La configuración del registro agregando controladores, formateadores y "
"filtros es responsabilidad del desarrollador de la aplicación, no del "
"desarrollador de la biblioteca. Si mantiene una biblioteca, asegúrese de no "
"agregar controladores a ninguno de sus registradores que no sean una "
"instancia :class:`~logging.NullHandler`."

#: ../Doc/howto/logging-cookbook.rst:3052
msgid "Creating a lot of loggers"
msgstr ""
msgstr "Crando muchos registradores (*loggers*)"

#: ../Doc/howto/logging-cookbook.rst:3054
msgid ""
Expand All @@ -2374,3 +2411,11 @@ msgid ""
"those describing areas within your application (generally modules, but "
"occasionally slightly more fine-grained than that)."
msgstr ""
"Los registradores son singletons que nunca se liberan durante la ejecución "
"de un script, por lo que la creación de muchos registradores consumirá "
"memoria que luego no se puede liberar. En lugar de crear un registrador por "
"ej. archivo procesado o conexión de red realizada, use los :ref:`mecanismos "
"existentes <context-info>` para pasar información contextual a sus registros "
"y restringir los registradores creados a aquellos que describen áreas dentro "
"de su aplicación (generalmente módulos, pero ocasionalmente un poco más "
"fino) granulado que eso)."