logger!
This commit is contained in:
parent
e139685d87
commit
bfc431e8ca
@ -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:
|
||||
...
|
7
libs/utils/logger/__init__.py
Normal file
7
libs/utils/logger/__init__.py
Normal file
@ -0,0 +1,7 @@
|
||||
# -------------------------------
|
||||
# Difficult Rocket
|
||||
# Copyright © 2020-2023 by shenjackyuanjie 3695888@qq.com
|
||||
# All rights reserved
|
||||
# -------------------------------
|
||||
|
||||
|
29
libs/utils/logger/types.py
Normal file
29
libs/utils/logger/types.py
Normal 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
|
Loading…
Reference in New Issue
Block a user