def msg(string, level=INFO):
    """ Handle messages; this takes care of logging and
    debug checking, as well as output colors
    """

    string = "[%s] %s" % (timestamp(), string)
    color_string = None
    if 'linux' in platform.platform().lower():
        if level is INFO:
            color_string = '%s%s%s' % ('\033[32m', string, '\033[0m')
        elif level is DEBUG:
            color_string = '%s%s%s' % ('\033[34m', string, '\033[0m')
        elif level is ERROR:
            color_string = '%s%s%s' % ('\033[31m', string, '\033[0m')
        else:
            color_string = string

    if not color_string:
        color_string = string

    if level is DEBUG and not config.DEBUG:
        return

    if not level is LOG:
        print color_string

    log(string)
dataset/ETHPy150Open hatRiot/PeachOrchard/node/src/core/utility.py/msg/original