[AGIPD][CORRECT] Clean up before AGIPD calcalt_interface changes
1 unresolved thread
1 unresolved thread
Compare changes
Files
2```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
```
In hindsight I wonder now, should we use
from warnings import warn
orfrom logging import warning
? For the latter, my prototype usedlogging.captureWarnings
. It would have the additional benefit we capture "other" warnings as well.@kluyvert Are you aware of a canonical opinion on this one?
The Python logging howto suggests:
People don't exactly agree on this, though.
From a practical perspective, the warnings module offers some possibilities that logging doesn't, like turning warnings into exceptions or displaying only the first instance of each warning. And warnings are visible by default, whereas logging has to be set up to show anything. But if you're using the logging framework anyway, then
log.warning()
associates them with a particular logger (normally associated with a module), which allows for better filtering.From the Python logging howto, indeed
logging.warning
seems to be the right choice. I'm not yet sure we can make use of multiple loggers given for notebooks, it'll be set up magically and they're using the default logger anyway (or the warning one if we'd usewarnings.warn()
). But heck, in the end as long as the handler supports multiple loggers, it doesn't even matter.