Fix | 没加进去的参数
This commit is contained in:
parent
8a61010877
commit
976da68d24
@ -39,8 +39,7 @@ class LogMessage:
|
||||
log_time: Optional[float] = None,
|
||||
logger_name: Optional[str] = 'root',
|
||||
logger_tag: Optional[str] = None,
|
||||
stack_trace: Optional[FrameType] = None,
|
||||
**kwargs) -> None:
|
||||
stack_trace: Optional[FrameType] = None) -> None:
|
||||
"""
|
||||
Init for LogMessage
|
||||
:param messages: message list for log
|
||||
@ -52,7 +51,6 @@ class LogMessage:
|
||||
:param logger_name: name of logger
|
||||
:param logger_tag: tag of logger
|
||||
:param stack_trace: stack trace of logger
|
||||
:param kwargs: other options
|
||||
"""
|
||||
# 20231128 23:23
|
||||
# 因为 Options 的初始化太慢了 所以改为不继承 直接编写
|
||||
@ -63,7 +61,7 @@ class LogMessage:
|
||||
self.level = level
|
||||
self.logger_name = logger_name
|
||||
self.logger_tag = logger_tag
|
||||
|
||||
self.stack_trace = stack_trace
|
||||
|
||||
if log_time is None:
|
||||
log_time = time.time_ns()
|
||||
@ -73,6 +71,18 @@ class LogMessage:
|
||||
flush = True if flush else False
|
||||
self.flush = flush
|
||||
|
||||
def option(self) -> Dict[str, Union[str, int, float, bool]]:
|
||||
return {
|
||||
'messages': self.messages,
|
||||
'end': self.end,
|
||||
'split': self.split,
|
||||
'flush': self.flush,
|
||||
'level': self.level,
|
||||
'log_time': self.log_time,
|
||||
'logger_name': self.logger_name,
|
||||
'logger_tag': self.logger_tag,
|
||||
'stack_trace': self.stack_trace,
|
||||
}
|
||||
|
||||
def format_message(self) -> str:
|
||||
if self.split is None:
|
||||
|
Loading…
Reference in New Issue
Block a user