Some Small Updates :)

This commit is contained in:
Bigsk 2020-11-18 15:46:35 +08:00
parent 9fa1b54b99
commit 5b6592869b

View File

@ -41,7 +41,7 @@ class GMCLCore(object):
''':Type Type of the log info'''
''':Text The main text of log info'''
''':Function The function that cause the log,the default value is "Anonymous Function"'''
''':Type The type of the error,the default value is "TypeError"'''
''':Type The type of the error,the default value is "TypeError",Support "TypeError","ValueError","UserWarning"'''
if(Text!="" or None):
if(Type=="info"):
self.__Log.append(("INFO",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Function,Text))
@ -51,7 +51,12 @@ class GMCLCore(object):
return ("WARN",Text)
elif(Type=="error"):
self.__Log.append(("ERROR",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Function,Text,ErrorType))
raise TypeError(Text)
if(ErrorType=="TypeError"):
raise TypeError(Text)
elif(ErrorType=="ValueError"):
raise ValueError(Text)
else:
raise UserWarning(Text)
else:
self.__Log.append(("OTHER",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Function,Text))
return ("OTHER",Text)