(info_mapping)
print info in mapping.

    Args:
        info_mapping (dict): input(variables) or output mapping.

    Examples:
        >>> info_mapping = {
                "var_a": "hello",
                "var_b": "world"
            }
        >>> info_mapping = {
                "status_code": 500
            }
        >>> print_info(info_mapping)
        ==================== Output ====================
        Key              :  Value
        ---------------- :  ----------------------------
        var_a            :  hello
        var_b            :  world
        ------------------------------------------------
print info in mapping.
print info in mapping .
def print_info(info_mapping):
    """ print info in mapping.

    Args:
        info_mapping (dict): input(variables) or output mapping.

    Examples:
        >>> info_mapping = {
                "var_a": "hello",
                "var_b": "world"
            }
        >>> info_mapping = {
                "status_code": 500
            }
        >>> print_info(info_mapping)
        ==================== Output ====================
        Key              :  Value
        ---------------- :  ----------------------------
        var_a            :  hello
        var_b            :  world
        ------------------------------------------------

    """
    if not info_mapping:
        return

    content_format = "{:<16} : {:<}\n"
    content = "\n==================== Output ====================\n"
    content += content_format.format("Variable", "Value")
    content += content_format.format("-" * 16, "-" * 29)

    for key, value in info_mapping.items():
        if isinstance(value, (tuple, collections.deque)):
            continue
        elif isinstance(value, (dict, list)):
            value = json.dumps(value)
        elif value is None:
            value = "None"

        content += content_format.format(key, value)

    content += "-" * 48 + "\n"
    logger.info(content)
def print_info ( info_mapping ) : if not info_mapping : return content_format = "{:<16} : {:<}\n" content = "\n==================== Output ====================\n" content += content_format . format ( "Variable" , "Value" ) content += content_format . format ( "-" * 16 , "-" * 29 ) for key , value in info_mapping . items ( ) : if isinstance ( value , ( tuple , collections . deque ) ) : continue elif isinstance ( value , ( dict , list ) ) : value = json . dumps ( value ) elif value is None : value = "None" content += content_format . format ( key , value ) content += "-" * 48 + "\n" logger . info ( content )