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

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page