개정판 954a17b7
issue #000: now log not deleted
Change-Id: Ic2cf8747f6da95ec4463cf89ccedf52ab27dc65e
DTI_PID/DTI_PID/ExceptionHandler.py | ||
---|---|---|
11 | 11 |
from PyQt5.QtSvg import * |
12 | 12 |
from PyQt5 import QtWidgets |
13 | 13 |
import logging |
14 |
from datetime import datetime |
|
14 | 15 |
|
15 | 16 |
class QExceptionHandler(QObject): |
16 | 17 |
""" This is exception handler class """ |
... | ... | |
22 | 23 |
|
23 | 24 |
self.log_path = os.path.join(os.getenv('ALLUSERSPROFILE'), 'Digital PID', 'id2.log') |
24 | 25 |
self.logger = logging.getLogger(__name__) |
25 |
logging.basicConfig(filename=self.log_path , filemode='w', level=logging.CRITICAL) |
|
26 |
logging.basicConfig(filename=self.log_path , filemode='a', level=logging.CRITICAL) |
|
27 |
self.logger.critical(datetime.now().strftime('%Y-%m-%d %H:%M:%S') + '\n') |
|
26 | 28 |
|
27 | 29 |
def handler(self, exctype, value, traceback): |
28 | 30 |
""" log exception, file namd and line number """ |
내보내기 Unified diff