import logging
import colorlog
import os
import sys
class LogPrint(object):
"""
from log_print import LogPrint
import logging
logger = LogPrint(log_file_name="runtime.log", log_level=logging.DEBUG, console_output="True", file_mode="w")
logger.info("log info")
"""
def __init__(self, log_file_name="runtime.log", log_level=logging.DEBUG, console_output="True", file_mode="w"):
# 日志文件名
self.log_file_name = log_file_name
# 日志记录起始等级
self.log_level = log_level
# 窗口日志开关
self.console_output = console_output
# 日志记录方式,w清空写入或者a追加写入
self.file_mode = file_mode
# 窗口日志等级颜色字典
self.log_color_config = {
"DEBUG": "white",