def log_setup(is_debug=False, is_multiprocess=False):
    """Set up a standardized log format for the DataONE Python stack. All Python
    components should use this function. If ``is_multiprocess`` is True, include process
    ID in the log so that logs can be separated for each process.

    Output only to stdout and stderr.

    """
    format_str = (
        '%(asctime)s %(name)s %(module)s:%(lineno)d %(process)4d %(levelname)-8s %(message)s'
        if is_multiprocess
        else '%(asctime)s %(name)s %(module)s:%(lineno)d %(levelname)-8s %(message)s'
    )
    formatter = logging.Formatter(format_str, '%Y-%m-%d %H:%M:%S')
    console_logger = logging.StreamHandler(sys.stdout)
    console_logger.setFormatter(formatter)
    logging.getLogger('').addHandler(console_logger)
    if is_debug:
        logging.getLogger('').setLevel(logging.DEBUG)
    else:
        logging.getLogger('').setLevel(logging.INFO)
def log_setup ( is_debug = False , is_multiprocess = False ) : format_str = ( '%(asctime)s %(name)s %(module)s:%(lineno)d %(process)4d %(levelname)-8s %(message)s' if is_multiprocess else '%(asctime)s %(name)s %(module)s:%(lineno)d %(levelname)-8s %(message)s' ) formatter = logging . Formatter ( format_str , '%Y-%m-%d %H:%M:%S' ) console_logger = logging . StreamHandler ( sys . stdout ) console_logger . setFormatter ( formatter ) logging . getLogger ( '' ) . addHandler ( console_logger ) if is_debug : logging . getLogger ( '' ) . setLevel ( logging . DEBUG ) else : logging . getLogger ( '' ) . setLevel ( logging . INFO )
Set up a standardized log format for the DataONE Python stack. All Python
    components should use this function. If ``is_multiprocess`` is True, include process
    ID in the log so that logs can be separated for each process.

    Output only to stdout and stderr.