Skip to main content
https://img.shields.io/badge/stdlib--only-yes-green.svg https://travis-ci.org/cjrh/arglog.svg?branch=master https://coveralls.io/repos/github/cjrh/arglog/badge.svg?branch=master https://img.shields.io/pypi/pyversions/arglog.svg

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)

Table of built distributions (wheels) for arglog 2017.6.2
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

2017.6.2 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page