def lastMsg(ss): try: print 'Error: %s' % str(ss) if Speaker._root_logger: Speaker._root_logger.info('spkr_error %s ' % str(ss)) if Speaker._totwisted: _twilog('spkr_error %s ' % str(ss)) except: pass
def log_error(msg, *a, **kw): try: if Speaker._totwisted: #_twilog('spkr (ERROR): %s ' % msg, *a, **kw) _twilog(('(ERROR): %s ' % msg) % a) if Speaker._root_logger: Speaker._root_logger.info('(ERROR): %s ' % msg, *a, **kw) except Exception, ss: Speaker.lastMsg(ss)
def log_critical(msg, *a, **kw): if Speaker.level > DBG_CRITICAL: return try: if Speaker._totwisted: #_twilog('spkr (CRITICAL): %s ' % msg, *a, **kw) _twilog(('(CRITICAL): %s ' % msg) % a) if Speaker._root_logger: Speaker._root_logger.info('(CRITICAL): %s ' % msg, *a, **kw) except Exception, ss: Speaker.lastMsg(ss)
def log_warning(msg, *a, **kw): if Speaker.level > DBG_WARNING: return try: if Speaker._totwisted: #_twilog('spkr (WARNING): %s ' % msg, *a, **kw) _twilog(('(WARNING): %s ' % msg) % a) if Speaker._root_logger: Speaker._root_logger.info('(WARNING): %s ' % msg, *a, **kw) except Exception, ss: Speaker.lastMsg(ss)
def log_debug(msg, *a, **kw): if Speaker.level > DBG_INSANE: return try: if Speaker._totwisted: #_twilog('spkr (DEBUG): %s ' % msg, *a, **kw) _twilog(('(DEBUG): %s ' % msg) % a) if Speaker._root_logger: Speaker._root_logger.info('(DEBUG): %s ' % msg, *a, **kw) except Exception, ss: Speaker.lastMsg(ss)