Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 20 lines (16 sloc) 0.667 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
""" uses logging with an explicit configuration"""

import verboselib
import logging

# This is one way, where you turn off things you don't want to see
# and everything is on by default
logging.basicConfig(level=logging.DEBUG)
logging.getLogger("verboselib").setLevel(logging.WARN)
# ... more lines for each library you want to squelch, not very pretty


if __name__ == '__main__':
    vl = verboselib.Noisy()
    logging.info("This will be output, because we set global to DEBUG.")
    logging.info("But not the verbose lib calls below at debug and info")
    vl.do_debug()
    vl.do_info()
    logging.warn("Watch out! about to log from noisy!")
    vl.do_warn()
Something went wrong with that request. Please try again.