1
0
mirror of https://github.com/Eyre-S/Coeur-Morny-Cono-python.git synced 2024-09-27 18:56:20 +08:00
Coeur-Morny-Cono-python/logger/log_appender.py
Eyre_S b9b06596b6
简单完成 messiva 功能实现,完成 ServerMain(start.py) 重写
- 附带添加 define 声明
  - 由于系统差异未能实现编译时间戳与可执行件 md5 校验值的功能
- 附带添加 MornyHello 重写
2022-09-26 16:08:18 +08:00

22 lines
569 B
Python

from datetime import datetime
import threading
from .log import *
def output (message:Log) :
print(format_message(message))
def format_message (log:Log) -> str :
origins = log.message.split("\n")
message = ""
message += f"[{datetime.fromtimestamp(log.timestamp/1000/1000/1000).strftime('%Y-%m-%d/%H:%M:%S:%f')}]" + \
f"[{threading.current_thread().name }]"
promptNewLine = "'"*len(message)
message += f"[{log.level.name}]{origins[0]}"
for i in range(len(origins)-1) :
message += f"\n{promptNewLine}[{log.level.name}]{origins[i+1]}"
return message