🐛 Fix TypeError in call of escape_tag

This commit is contained in:
mobyw 2023-04-16 15:23:21 +08:00
parent 10499d1e33
commit fdf16ff9a3

View File

@ -11,13 +11,13 @@ class logger:
@staticmethod
def info(command: str, info: str = '', param: Dict[str, any] = None, result: str = '', result_type: bool = True):
param_str = ' '.join([f'{k}<m>{escape_tag(v)}</m>' for k, v in param.items()]) if param else ''
param_str = ' '.join([f'{k}<m>{escape_tag(str(v))}</m>' for k, v in param.items()]) if param else ''
result_str = f'<g>{escape_tag(result)}</g>' if result_type else f'<r>{escape_tag(result)}</r>' if result else ''
nb_logger.opt(colors=True).info(f'<u><y>[{command}]</y></u>{info}{param_str}{result_str}')
@staticmethod
def success(command: str, info: str = '', param: Dict[str, any] = None, result: str = ''):
param_str = ' '.join([f'{k}<m>{escape_tag(v)}</m>' for k, v in param.items()]) if param else ''
param_str = ' '.join([f'{k}<m>{escape_tag(str(v))}</m>' for k, v in param.items()]) if param else ''
result_str = f'<g>{escape_tag(result)}</g>' if result else ''
nb_logger.opt(colors=True).success(f'<u><y>[{command}]</y></u>{info}{param_str}{result_str}')