<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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)