parent
1da2dc8c7f
commit
3f42a354d1
20
log/log.c
20
log/log.c
|
@ -230,6 +230,11 @@ void IHW_EnableLogLevel(unsigned int level, int iEnable)
|
|||
}
|
||||
}
|
||||
|
||||
static void __runLogService(void)
|
||||
{
|
||||
pthread_create(&g_logThreadId, NULL, __logOutputThread, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 初始化系统日志功能
|
||||
* @param pLogTag 系统日志标志
|
||||
|
@ -282,12 +287,7 @@ void IHW_InitLOG(const char *pLogTag, const char *pPath, int bEnable)
|
|||
|
||||
g_bEnableLog = bEnable;
|
||||
|
||||
IHW_RunLogService();
|
||||
}
|
||||
|
||||
void IHW_RunLogService(void)
|
||||
{
|
||||
pthread_create(&g_logThreadId, NULL, __logOutputThread, NULL);
|
||||
__runLogService();
|
||||
}
|
||||
|
||||
static void __logTo(unsigned int level, int isAddTag, char *pMsg, int isPrint)
|
||||
|
@ -381,6 +381,9 @@ void IHW_LOG(unsigned int level, const char *pMsg, ...)
|
|||
utstring_free(pLogContent);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 等待全部日志输出
|
||||
*/
|
||||
void IHW_WaitFinishLogout(void)
|
||||
{
|
||||
PLOG_ITEM pItem = NULL;
|
||||
|
@ -399,6 +402,11 @@ void IHW_WaitFinishLogout(void)
|
|||
} while(!g_bEnableLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 获取日志等级字符串
|
||||
* @param lv 日志等级
|
||||
* @return 当前日志等级的字符串值
|
||||
*/
|
||||
const char *LogLeveToString(unsigned int lv)
|
||||
{
|
||||
switch(lv) {
|
||||
|
|
Loading…
Reference in New Issue