OLD | NEW |
1 # Logging in infra.git | 1 # Logging in infra.git |
2 | 2 |
3 ## Features | 3 ## Features |
4 | 4 |
5 The `infra_libs.logs` package contains some code to simplify logging and | 5 The `infra_libs.logs` package contains some code to simplify logging and |
6 make it consistent and easily configurable. Using it makes your code | 6 make it consistent and easily configurable. Using it makes your code |
7 future-proof. | 7 future-proof. |
8 | 8 |
9 Offered features: | 9 Offered features: |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 LOGGER.info('great message') | 50 LOGGER.info('great message') |
51 LOGGER.error('terrible error') | 51 LOGGER.error('terrible error') |
52 ``` | 52 ``` |
53 | 53 |
54 Using `logging.getLogger` is a good practice in general (not restricted to | 54 Using `logging.getLogger` is a good practice in general (not restricted to |
55 using infra_libs.logs) because it allows for module blacklisting and | 55 using infra_libs.logs) because it allows for module blacklisting and |
56 other goodness. It should be done at import time. See also the official | 56 other goodness. It should be done at import time. See also the official |
57 [logging HOWTO](https://docs.python.org/2/howto/logging.html). | 57 [logging HOWTO](https://docs.python.org/2/howto/logging.html). |
58 `infra_libs.logs` also formats the output of the root logger, but using | 58 `infra_libs.logs` also formats the output of the root logger, but using |
59 this logger is not recommended. | 59 this logger is not recommended. |
OLD | NEW |