Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
|
script:python:new:api [2014/08/10 13:38] alfred [Logging] |
script:python:new:api [2020/05/09 09:25] (actual) |
||
|---|---|---|---|
| Línea 667: | Línea 667: | ||
| </code> | </code> | ||
| - | === Notas === | + | === Para mostrar información de la excepción === |
| - | Desactivar el log: | + | |
| - | <code python> | + | |
| - | logging.getLogger().disabled = True | + | |
| - | </code> | + | |
| - | + | ||
| - | ==== Logging (II) ==== | + | |
| - | === Things you can do with the log === | + | |
| - | * To send exception information: | + | |
| <code python> | <code python> | ||
| try: | try: | ||
| Línea 684: | Línea 676: | ||
| logger.error('Failed to open file', exc_info=True) | logger.error('Failed to open file', exc_info=True) | ||
| </code> | </code> | ||
| + | |||
| + | === Notas === | ||
| + | Desactivar el log: | ||
| + | <code python> | ||
| + | logging.getLogger().disabled = True | ||
| + | </code> | ||
| + | |||
| + | |||
| ==== Imports dinámicos ==== | ==== Imports dinámicos ==== | ||
| A partir del módulo ''imp'' podemos realizar imports por código. Este módulo tiene funciones como... | A partir del módulo ''imp'' podemos realizar imports por código. Este módulo tiene funciones como... | ||