9 #include <netinet/in.h>
11 #include "core/EmxTypeDef.hpp"
14 #define EMX_LOG_MAX_SIZE (1024*4)
48 char path[EMX_MAX_PATH_SIZE];
66 int32_t line,
const char *fmt, ...);
73 void Print(
const char *fmt, ...);
83 void Print(
const char *file,
const char *func,
84 int32_t line,
const char *fmt, ...);
91 void Save(
const char *fmt, ...);
144 void CreateChannel();
146 void DestroyChannel();
155 Config::Shared *m_shared;
164 #define xlogpt(level, fmt, ...) \
165 emxLog.Print(level, __FILE__, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
168 #define emxlogc(fmt, ...) xlogpt(Emx::Log::LevelE::Crt, fmt, ##__VA_ARGS__)
170 #define emxloge(fmt, ...) xlogpt(Emx::Log::LevelE::Err, fmt, ##__VA_ARGS__)
172 #define emxlogw(fmt, ...) xlogpt(Emx::Log::LevelE::Warn, fmt, ##__VA_ARGS__)
174 #define emxlogi(fmt, ...) xlogpt(Emx::Log::LevelE::Info, fmt, ##__VA_ARGS__)
176 #define emxlogd(fmt, ...) xlogpt(Emx::Log::LevelE::Debug, fmt, ##__VA_ARGS__)
178 #define emxlogt(fmt, ...) xlogpt(Emx::Log::LevelE::Trace, fmt, ##__VA_ARGS__)
180 #define emxlogn(fmt, ...) emxLog.Print(fmt, ##__VA_ARGS__)
182 #define emxlogx(fmt, ...) emxLog.Print(__FILE__, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
日志系统客户端
Definition: EmxLog.hpp:22
ErrCodeE GetConfig(Config &cfg)
获取日志系统配置
void Print(LevelE level, const char *file, const char *func, int32_t line, const char *fmt,...)
打印普通日志
void SetAsync(bool ena)
设置日志打印异步模式
void Print(const char *fmt,...)
打印不带额外格式化信息的普通日志
void Save(const char *fmt,...)
保存日志到flash
LevelE
日志等级
Definition: EmxLog.hpp:26
LevelE GetLevel()
获取全局日志等级
ErrCodeE SetConfig(Config &cfg)
配置日志系统
void SetLevel(LevelE level)
配置全局日志等级
void Print(const char *file, const char *func, int32_t line, const char *fmt,...)
打印普通日志,同步本地阻塞打印,无打印等级控制
bool GetAsync()
获取日志打印异步模式
ErrCodeE
错误码定义
Definition: EmxTypeDef.hpp:29
Definition: EmxGpio.hpp:10
LogServer存储通道的配置信息
Definition: EmxLog.hpp:45
char path[EMX_MAX_PATH_SIZE]
Definition: EmxLog.hpp:48
int32_t maxSizeKB
Definition: EmxLog.hpp:46
int32_t maxNum
Definition: EmxLog.hpp:47
各个进程包括LogServer共享的内存的数据
Definition: EmxLog.hpp:39
LevelE level
日志等级
Definition: EmxLog.hpp:40
bool async
是否是异步打印,异步打印由LogServer统一收集并打印,同步打印在各自进程的调用处打印
Definition: EmxLog.hpp:41
配置Log系统
Definition: EmxLog.hpp:36
struct Emx::Log::Config::Channel normal
struct Emx::Log::Config::Shared shared
struct Emx::Log::Config::Channel flash