Emx::Log类 参考

日志系统客户端

#include "EmxLog.hpp"

struct  Config
 配置Log系统 更多...
 

Public 类型

enum class  LevelE : uint8_t {
  Crt = 0 , Err , Warn , Info ,
  Debug , Trace
}
 日志等级 更多...
 

Public 成员函数

 Log ()
 
 ~Log ()
 
void Print (LevelE level, const char *file, const char *func, int32_t line, const char *fmt,...)
 打印普通日志 更多...
 
void Print (const char *fmt,...)
 打印不带额外格式化信息的普通日志 更多...
 
void Print (const char *file, const char *func, int32_t line, const char *fmt,...)
 打印普通日志,同步本地阻塞打印,无打印等级控制 更多...
 
void Save (const char *fmt,...)
 保存日志到flash 更多...
 
void SetLevel (LevelE level)
 配置全局日志等级 更多...
 
LevelE GetLevel ()
 获取全局日志等级 更多...
 
void SetAsync (bool ena)
 设置日志打印异步模式 更多...
 
bool GetAsync ()
 获取日志打印异步模式 更多...
 
ErrCodeE SetConfig (Config &cfg)
 配置日志系统 更多...
 
ErrCodeE GetConfig (Config &cfg)
 获取日志系统配置 更多...
 
ErrCodeE Pause ()
 暂停日志记录 更多...
 
ErrCodeE Resume ()
 恢复日志记录 更多...
 

成员枚举类型说明

◆ LevelE

enum Emx::Log::LevelE : uint8_t
strong
枚举值
Crt 

紧急

Err 

错误

Warn 

告警

Info 

通知

Debug 

调试

Trace 

跟踪

构造及析构函数说明

◆ Log()

Emx::Log::Log ( )

◆ ~Log()

Emx::Log::~Log ( )

成员函数说明

◆ Print() [1/3]

void Emx::Log::Print ( LevelE  level,
const char *  file,
const char *  func,
int32_t  line,
const char *  fmt,
  ... 
)
参数
level[in] 日志等级
file[in] 所属文件
func[in] 所属函数
line[in] 所在行数
fmt[in] 格式化参数
...[in] 可变参数

◆ Print() [2/3]

void Emx::Log::Print ( const char *  fmt,
  ... 
)
参数
fmt[in] 格式化参数
...[in] 可变参数

◆ Print() [3/3]

void Emx::Log::Print ( const char *  file,
const char *  func,
int32_t  line,
const char *  fmt,
  ... 
)
参数
file[in] 所属文件
func[in] 所属函数
line[in] 所在行数
fmt[in] 格式化参数
...[in] 可变参数

◆ Save()

void Emx::Log::Save ( const char *  fmt,
  ... 
)
参数
fmt[in] 格式化参数
...[in] 可变参数

◆ SetLevel()

void Emx::Log::SetLevel ( LevelE  level)
参数
level[in]日志等级

◆ GetLevel()

LevelE Emx::Log::GetLevel ( )
返回
LevelE

◆ SetAsync()

void Emx::Log::SetAsync ( bool  ena)
参数
ena[in] true:使能异步打印;false:同步打印

◆ GetAsync()

bool Emx::Log::GetAsync ( )
返回
bool true:异步打印;false:同步打印

◆ SetConfig()

ErrCodeE Emx::Log::SetConfig ( Config cfg)
参数
cfg[in] 配置参数
返回
ErrCodeE

◆ GetConfig()

ErrCodeE Emx::Log::GetConfig ( Config cfg)
参数
cfg[out] 配置参数
返回
ErrCodeE

◆ Pause()

ErrCodeE Emx::Log::Pause ( )
返回
ErrCodeE

◆ Resume()

ErrCodeE Emx::Log::Resume ( )
返回
ErrCodeE