File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -407,10 +407,23 @@ def get_fix_ts_token_tokenparam(cls):
407407 @classmethod
408408 def jm_log (cls , topic : str , msg : str , e : Exception = None ):
409409 if cls .FLAG_ENABLE_JM_LOG is True :
410- try :
411- cls .EXECUTOR_LOG (topic , msg , e )
412- except TypeError :
413- cls .EXECUTOR_LOG (topic , msg )
410+ executor = cls .EXECUTOR_LOG
411+ if e is None :
412+ executor (topic , msg )
413+ else :
414+ import inspect
415+ try :
416+ sig = inspect .signature (executor )
417+ params_count = len (sig .parameters )
418+ except (ValueError , TypeError ):
419+ params_count = 2
420+
421+ if params_count >= 3 :
422+ executor (topic , msg , e )
423+ else :
424+ import warnings
425+ warnings .warn ('jmcomic已升级到标准logging,建议将EXECUTOR_LOG重新定义为3个参数以接收异常对象 (topic, msg, e)' )
426+ executor (topic , msg )
414427
415428 @classmethod
416429 def disable_jm_log (cls ):
You can’t perform that action at this time.
0 commit comments