|
@@ -7,6 +7,7 @@ import sys
|
|
import os
|
|
import os
|
|
import logging
|
|
import logging
|
|
from datetime import datetime
|
|
from datetime import datetime
|
|
|
|
+import warnings
|
|
|
|
|
|
sys.path.append(os.getcwd())
|
|
sys.path.append(os.getcwd())
|
|
|
|
|
|
@@ -121,9 +122,20 @@ class Log():
|
|
|
|
|
|
raise Exception(message)
|
|
raise Exception(message)
|
|
|
|
|
|
|
|
+ def log_and_throw_warning(self, message):
|
|
|
|
+ '''
|
|
|
|
+ '''
|
|
|
|
+ self._logger.warning(message)
|
|
|
|
+
|
|
|
|
+ raise warnings.warn(message)
|
|
|
|
+
|
|
def log_and_raise_warning(self, message):
|
|
def log_and_raise_warning(self, message):
|
|
'''
|
|
'''
|
|
'''
|
|
'''
|
|
|
|
+ warnings.warn(("This method has been depricated. "
|
|
|
|
+ "User log_and_throw_warning instead"),
|
|
|
|
+ DeprecationWarning)
|
|
|
|
+
|
|
self._logger.warning(message)
|
|
self._logger.warning(message)
|
|
|
|
|
|
- raise Warning(message)
|
|
|
|
|
|
+ raise warnings.warn(message)
|