Skip to main content


Project description


Add logging options to argparse automatically


import argparse
import logging
import arglog

if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    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 --loglevel=WARNING

All of the logging levels are supported, INFO, DEBUG and so on.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for arglog, version 2017.6.2
Filename, size File type Python version Upload date Hashes
Filename, size arglog-2017.6.2-py2.py3-none-any.whl (14.3 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page