[openrtm-commit:00184] r415 - trunk/OpenRTM-aist-Python/OpenRTM_aist

openrtm @ openrtm.org openrtm @ openrtm.org
2011年 6月 16日 (木) 16:03:44 JST


Author: kurihara
Date: 2011-06-16 16:03:44 +0900 (Thu, 16 Jun 2011)
New Revision: 415

Modified:
   trunk/OpenRTM-aist-Python/OpenRTM_aist/SystemLogger.py
Log:
r378 merged.

Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/SystemLogger.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/SystemLogger.py	2011-06-16 06:59:17 UTC (rev 414)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/SystemLogger.py	2011-06-16 07:03:44 UTC (rev 415)
@@ -14,7 +14,8 @@
 #         Advanced Industrial Science and Technology (AIST), Japan
 #     All rights reserved.
 
-
+import sys
+import traceback
 import time
 import threading
 import logging
@@ -36,9 +37,9 @@
 #
 # @endif
 class Logger:
+  """
+  """
 
-
-
   SILENT    = 0  # ()
   FATAL     = 41 # (FATAL)
   ERROR     = 40 # (FATAL, ERROR)
@@ -251,7 +252,32 @@
       logging.getLogger("").addHandler(ch)
 
 
+  ##
+  # @if jp
+  #
+  # @brief 例外情報出力
+  #  例外情報を文字列で返す。
+  #
+  # @return 例外情報の文字列出力
+  #
+  # @else
+  #
+  # @brief Print exception information 
+  # @return Return exception information string.
+  #
+  # @endif
+  def print_exception():
+    if sys.version_info[0:3] >= (2, 4, 0):
+      return traceback.format_exc()
+    else:
+      _exc_list = traceback.format_exception(*sys.exc_info())
+      _exc_str = "".join(_exc_list)
+      return _exc_str
+    
+  print_exception = staticmethod(print_exception)
 
+
+
 ##
 # @if jp
 #
@@ -265,6 +291,8 @@
 #
 # @endif
 class LogStream:
+  """
+  """
 
   ##
   # @if jp
@@ -297,6 +325,10 @@
     self.logger = logging.getLogger(name)
 
 
+  def __del__(self):
+    logging.shutdown()
+    return
+
   def addHandler(self, *args):
     if self._loggerObj is not None:
       self._loggerObj.addHandler(*args)


Property changes on: trunk/OpenRTM-aist-Python/OpenRTM_aist/SystemLogger.py
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/RELENG_1_0/OpenRTM-aist-Python/OpenRTM_aist/SystemLogger.py:345-395
/branches/RELENG_1_1/OpenRTM-aist-Python/OpenRTM_aist/SystemLogger.py:396-412



openrtm-commit メーリングリストの案内