Exemple #1
0
def log(msg, logLevel='info'):
    msg = unicode(msg, "utf-8")
    if logLevel == 'debug':
        Debug.log(msg)
        print '[debug] %s' % msg
    elif logLevel == 'info':
        Debug.info(msg)
        print '[info] %s' % msg
    elif logLevel == 'error':
        Debug.error(msg)
        print '[error] %s' % msg
Exemple #2
0
def log(content):
    caller = inspect.getframeinfo(inspect.currentframe().f_back)[2]
    print "[%s] [%s] %s" % (str(datetime.now().strftime('%Y-%m-%d %H:%M:%S')), caller, content)
    Debug.user(content)