程式寫的很長之後,用 try catch 包起來,不知道是那一行錯:
try:
... your codes ...
except Exception as ex:
print(ex)
解法:
import logging logging.basicConfig() logger = logging.getLogger('logger')
except Exception as ex:
logger.error(ex, exc_info=True)