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.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

arglog-2017.6.2-py2.py3-none-any.whl (14.3 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page