setup global logging

def setup_logging(namespace):
    """
    setup global logging
    """

    loglevel = {
        0: logging.ERROR,
        1: logging.WARNING,
        2: logging.INFO,
        3: logging.DEBUG,
    }.get(namespace.verbosity, logging.DEBUG)

    if namespace.verbosity > 1:
        logformat = '%(levelname)s csvpandas %(lineno)s %(message)s'
    else:
        logformat = 'csvpandas %(message)s'

    logging.basicConfig(stream=namespace.log, format=logformat, level=loglevel)