arglog
Add logging options to argparse automatically
Demo
# main.py
import argparse
import logging
import arglog
if __name__ == '__main__':
parser = argparse.ArgumentParser()
arglog.patch(parser)
args = parser.parse_args()
This will trigger the same effect as running:
logging.basicConfig(level='<level name>')
However, you now also have a new CLI option for your program:
$ python main.py --loglevel=WARNING
All of the logging levels are supported, INFO, DEBUG and so on.
Release files for arglog 2017.6.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arglog-2017.6.2-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Release files / arglog-2017.6.2-py2.py3-none-any.whl
| Download URL | arglog-2017.6.2-py2.py3-none-any.whl |
|---|---|
| Size | 14.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
02b1bc5faef9dc50b4d49125924d8e866c2dd8c135962f12480294419e50f856
|
|
BLAKE2b-256 checksum How to use checksums |
3278da132b403850a004db3a66736eec32b87ef6cad8648acce893f15d408603
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |