[tuxdroid-svn] r5264 - software_suite_v3/smart-core/smart-server/trunk/util/logger
Status: Beta
Brought to you by:
ks156
|
From: remi <c2m...@c2...> - 2009-08-01 11:58:32
|
Author: remi
Date: 2009-08-01 13:58:11 +0200 (Sat, 01 Aug 2009)
New Revision: 5264
Modified:
software_suite_v3/smart-core/smart-server/trunk/util/logger/SimpleLogger.py
Log:
* Fixed a possible file IO error
Modified: software_suite_v3/smart-core/smart-server/trunk/util/logger/SimpleLogger.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/util/logger/SimpleLogger.py 2009-08-01 11:57:35 UTC (rev 5263)
+++ software_suite_v3/smart-core/smart-server/trunk/util/logger/SimpleLogger.py 2009-08-01 11:58:11 UTC (rev 5264)
@@ -121,9 +121,14 @@
if self.__target in [LOG_TARGET_FILE, LOG_TARGET_BOTH]:
if os.path.isfile(self.__logFileName):
self.__logMutex.acquire()
- f = open(self.__logFileName, 'a')
- f.write(message + "\n")
- f.close()
+ try:
+ f = open(self.__logFileName, 'a')
+ try:
+ f.write(message + "\n")
+ finally:
+ f.close()
+ except:
+ pass
self.__logMutex.release()
if self.__target in [LOG_TARGET_SHELL, LOG_TARGET_BOTH]:
print message
|