logger!

This commit is contained in:
shenjack 2023-10-13 22:58:42 +08:00
parent e139685d87
commit bfc431e8ca
Signed by: shenjack
GPG Key ID: 7B1134A979775551
3 changed files with 36 additions and 21 deletions

View File

@ -1,21 +0,0 @@
# -------------------------------
# Difficult Rocket
# Copyright © 2020-2023 by shenjackyuanjie 3695888@qq.com
# All rights reserved
# -------------------------------
from typing import List
class BaseHandler:
...
class Logger:
level: int = 0
handlers: List[BaseHandler] = []
enable: bool = True
class BaseFormatter:
...

View File

@ -0,0 +1,7 @@
# -------------------------------
# Difficult Rocket
# Copyright © 2020-2023 by shenjackyuanjie 3695888@qq.com
# All rights reserved
# -------------------------------

View File

@ -0,0 +1,29 @@
# -------------------------------
# Difficult Rocket
# Copyright © 2020-2023 by shenjackyuanjie 3695888@qq.com
# All rights reserved
# -------------------------------
import time
from types import FrameType
from typing import List, Optional
from Difficult_Rocket.api.types import Options
class LogMessage(Options):
name = 'LogMessage'
# 消息内容本身的属性
messages: List[str] = []
end: str = '\n'
split: str = ' '
# 消息的属性
flush: bool = True
level: int = 20
log_time: float = time.time_ns()
logger_name: str = 'root'
logger_tag: Optional[str] = None
stack_trace: Optional[FrameType] = None