프로젝트

일반

사용자정보

개정판 954a17b7

ID954a17b7adcc35fd107b7f9f8c707a82e40fe51c
상위 d80c61e6
하위 b80576d8

함의성이(가) 5년 이상 전에 추가함

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

클립보드 이미지 추가 (최대 크기: 500 MB)