arxiv.py
arxiv.py copied to clipboard
Use Python logging best practices
Motivation
A clear and concise description of what the problem is. For example, "I'm always frustrated when..."
- Change how logging is exposed. Setting the logging level is difficult. There must be a standard Python pattern for this, e.g. using a named logger with a name other than
__name__
. - Change internal logging usage: logging upon error construction can be misleading, esp. when errors are nonterminal (i.e. resolved in retries). https://github.com/lukasschwab/arxiv.py/issues/43#issuecomment-817890164
Solution
A clear and concise description of what you want to happen.
TODO
This was improved with 347327a, but there's still room for improvement.
- Standardizing log messaging (e.g. punctuation).
- Promoting essential
extra
fields into messages. Standardizingextra
field names to make them easier to format. - Unit tests for evergreen logging behavior, e.g. logging retries.
- Creating child loggers for each
.get()
generator.
Wouldn't mind some input from someone confident in their Python logging patterns.