2 Star 0 Fork 0

超级大蘑菇头 / DebugTools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
log.py 510 Bytes
一键复制 编辑 原始数据 按行查看 历史
超级大蘑菇头 提交于 2021-12-17 10:41 . 简化log模块
import datetime
class LogHelper:
def __init__(self, config):
self.config = config
def __log(self, tag, msg):
msg = msg.replace('\r', '').replace('\n', '').replace('\t', '')
if msg and msg != "":
msg = "[{0}][{1}]: {2}".format(tag, datetime.datetime.now(), msg)
print(msg)
def info(self, msg):
self.__log("info", msg)
def warning(self, msg):
self.__log("warn", msg)
def error(self, msg):
self.__log("error", msg)
Python
1
https://gitee.com/mogoo/DebugTools.git
git@gitee.com:mogoo/DebugTools.git
mogoo
DebugTools
DebugTools
master

搜索帮助