Aestate
Public Member Functions | Static Public Member Functions | Public Attributes | Static Private Attributes | List of all members
aestate.util.Log.ALog Class Reference
Inheritance diagram for aestate.util.Log.ALog:
Inheritance graph
Collaboration diagram for aestate.util.Log.ALog:
Collaboration graph

Public Member Functions

def __init__ (self, path, print_flag=False, save_flag=False, max_clear=10)
 
def template (self, LogStatus status, *content, **kwargs)
 
def info (self, *content, **kwargs)
 
def warn (self, *content, **kwargs)
 
def error (self, *content, **kwargs)
 
def log_util (self, path_str, *content)
 
def get_path (self, end_path)
 
def __new__ (cls, *args, **kwargs)
 

Static Public Member Functions

def pure_log (msg, **kwargs)
 
def format_text (LogStatus field, line, obj, task_name, msg, ned_text=False, ConsoleColor.FontColor text_color=None)
 
def log (msg, obj=None, line=sys._getframe().f_back.f_lineno, task_name='TEXT', LogObject=None, LogStatus field=LogStatus.Info, func=None, ConsoleColor.FontColor text_color=None, **kwargs)
 
def warning (**kwargs)
 
def log_error (msg, obj=None, line=sys._getframe().f_back.f_lineno, task_name='ERROR', LogObject=None, raise_exception=False)
 

Public Attributes

 max_clear
 
 path
 
 print_flag
 
 save_flag
 

Static Private Attributes

 _instance_lock = threading.RLock()
 

Detailed Description

Definition at line 122 of file Log.py.

Constructor & Destructor Documentation

◆ __init__()

def aestate.util.Log.ALog.__init__ (   self,
  path,
  print_flag = False,
  save_flag = False,
  max_clear = 10 
)
初始化配置

:param path:保存的路径

:param print_flag:是否打印日志 默认False

:param save_flag:是否保存日志 默认False

:param max_clear:日志储存最大限制,默认10MB 单位:MB

Definition at line 125 of file Log.py.

Member Function Documentation

◆ __new__()

def aestate.util.Log.ALog.__new__ (   cls,
args,
**  kwargs 
)

Definition at line 366 of file Log.py.

◆ error()

def aestate.util.Log.ALog.error (   self,
content,
**  kwargs 
)
错误日志
:param content:内容
:return:

Definition at line 338 of file Log.py.

Here is the call graph for this function:

◆ format_text()

def aestate.util.Log.ALog.format_text ( LogStatus  field,
  line,
  obj,
  task_name,
  msg,
  ned_text = False,
ConsoleColor.FontColor   text_color = None 
)
static
将字符串格式化成好看的颜色

Definition at line 155 of file Log.py.

◆ get_path()

def aestate.util.Log.ALog.get_path (   self,
  end_path 
)
日志类获取绝对路径
:param end_path:
:return:

Definition at line 357 of file Log.py.

Here is the caller graph for this function:

◆ info()

def aestate.util.Log.ALog.info (   self,
content,
**  kwargs 
)
成功日志
:param content:内容
:return:

Definition at line 309 of file Log.py.

Here is the call graph for this function:

◆ log()

def aestate.util.Log.ALog.log (   msg,
  obj = None,
  line = sys._getframe().f_back.f_lineno,
  task_name = 'TEXT',
  LogObject = None,
LogStatus   field = LogStatus.Info,
  func = None,
ConsoleColor.FontColor   text_color = None,
**  kwargs 
)
static
输出任务执行日志

:param msg:消息
:param obj:执行日志的对象地址
:param line:被调用前的行数
:param task_name:任务对象的值
:param LogObject:写出文件的对象
:param field:日志模式
:param func:日志执行后的自定义操作

Definition at line 194 of file Log.py.

◆ log_error()

def aestate.util.Log.ALog.log_error (   msg,
  obj = None,
  line = sys._getframe().f_back.f_lineno,
  task_name = 'ERROR',
  LogObject = None,
  raise_exception = False 
)
static
:param msg:描述
:param line:行
:param obj:执行的对象,当允许抛出异常时,则指明该对象为一个Exception或他的子类
:param task_name:线程唯一名称
:param LogObject:日志对象
:param raise_exception:是否抛出异常

Definition at line 254 of file Log.py.

◆ log_util()

def aestate.util.Log.ALog.log_util (   self,
  path_str,
content 
)
日志工具
:param path_str:
:param content:
:return:

Definition at line 346 of file Log.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pure_log()

def aestate.util.Log.ALog.pure_log (   msg,
**  kwargs 
)
static
输出任务执行日志

:param msg:消息

Definition at line 145 of file Log.py.

◆ template()

def aestate.util.Log.ALog.template (   self,
LogStatus  status,
content,
**  kwargs 
)

Definition at line 287 of file Log.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ warn()

def aestate.util.Log.ALog.warn (   self,
content,
**  kwargs 
)
警告日志
:param content:内容
:return:

Definition at line 330 of file Log.py.

Here is the call graph for this function:

◆ warning()

def aestate.util.Log.ALog.warning ( **  kwargs)
static

Definition at line 250 of file Log.py.

Member Data Documentation

◆ _instance_lock

aestate.util.Log.ALog._instance_lock = threading.RLock()
staticprivate

Definition at line 123 of file Log.py.

◆ max_clear

aestate.util.Log.ALog.max_clear

Definition at line 139 of file Log.py.

◆ path

aestate.util.Log.ALog.path

Definition at line 140 of file Log.py.

◆ print_flag

aestate.util.Log.ALog.print_flag

Definition at line 141 of file Log.py.

◆ save_flag

aestate.util.Log.ALog.save_flag

Definition at line 142 of file Log.py.


The documentation for this class was generated from the following file: