def _setup_logging(stream=None):
 hdlr = logging.StreamHandler(stream)
 defaultFmt = '%(name)s: %(levelname)s: %(message)s'
 infoFmt = '%(name)s: %(message)s'
 fmtr = _PerLevelFormatter(fmt=defaultFmt, fmtFromLevel={logging.INFO: infoFmt})
 hdlr.setFormatter(fmtr)
 logging.root.addHandler(hdlr)
 log.setLevel(logging.INFO)

def _setup_logging ( stream = None ) : hdlr = logging . StreamHandler ( stream ) defaultFmt = '%(name)s: %(levelname)s: %(message)s' infoFmt = '%(name)s: %(message)s' fmtr = _PerLevelFormatter ( fmt = defaultFmt , fmtFromLevel = { logging . INFO : infoFmt } ) hdlr . setFormatter ( fmtr ) logging . root . addHandler ( hdlr ) log . setLevel ( logging . INFO )
do logging setup: we want a prettier default format: do: level: .