Some Small Updates :)
This commit is contained in:
parent
9fa1b54b99
commit
5b6592869b
9
core.py
9
core.py
@ -41,7 +41,7 @@ class GMCLCore(object):
|
|||||||
''':Type Type of the log info'''
|
''':Type Type of the log info'''
|
||||||
''':Text The main text of log info'''
|
''':Text The main text of log info'''
|
||||||
''':Function The function that cause the log,the default value is "Anonymous Function"'''
|
''':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(Text!="" or None):
|
||||||
if(Type=="info"):
|
if(Type=="info"):
|
||||||
self.__Log.append(("INFO",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Function,Text))
|
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)
|
return ("WARN",Text)
|
||||||
elif(Type=="error"):
|
elif(Type=="error"):
|
||||||
self.__Log.append(("ERROR",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Function,Text,ErrorType))
|
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:
|
else:
|
||||||
self.__Log.append(("OTHER",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Function,Text))
|
self.__Log.append(("OTHER",time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),Function,Text))
|
||||||
return ("OTHER",Text)
|
return ("OTHER",Text)
|
||||||
|
Reference in New Issue
Block a user