示例#1
0
文件: speaker.py 项目: efphe/mother
 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
示例#2
0
文件: speaker.py 项目: efphe/mother
 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)
示例#3
0
文件: speaker.py 项目: efphe/mother
 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)
示例#4
0
文件: speaker.py 项目: efphe/mother
 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)
示例#5
0
文件: speaker.py 项目: efphe/mother
 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)