diff --git a/frameworks/mini/hiview_log_limit.c b/frameworks/mini/hiview_log_limit.c index 216268713a0084fdc5ab83ad1a725969af3efaa6..1e91f5ba34bbf5b05df3d92aac6a8eff9e97f0c0 100755 --- a/frameworks/mini/hiview_log_limit.c +++ b/frameworks/mini/hiview_log_limit.c @@ -48,7 +48,7 @@ void InitLogLimit(void) pRule->maxNum = LOG_LIMIT_DEFAULT; pRule->logNum = 0; pRule->baseTime = 0; - pRule->totalLogNum = 0; + pRule->totalDropLogNum = 0; } SetLimitThreshold(HILOG_MODULE_HIVIEW, LOG_LIMIT_LEVEL3); SetLimitThreshold(HILOG_MODULE_APP, LOG_LIMIT_LEVEL2); @@ -78,7 +78,6 @@ boolean LogIsLimited(uint8 module) pLimitRule->baseTime = (uint16)(HIVIEW_GetCurrentTime() / MS_PER_SECOND); } pLimitRule->logNum++; - pLimitRule->totalLogNum++; logNum = pLimitRule->logNum; baseTime = pLimitRule->baseTime; if ((curTime < baseTime) || ((curTime - baseTime) >= LOG_LIMIT_CHECK_DURATION)) { @@ -89,6 +88,7 @@ boolean LogIsLimited(uint8 module) } } else { if (logNum > pLimitRule->maxNum) { + pLimitRule->totalDropLogNum++; return TRUE; } } @@ -106,10 +106,10 @@ void SetLimitThreshold(uint8 module, uint8 v) pRule->maxNum = v; pRule->logNum = 0; pRule->baseTime = 0; - pRule->totalLogNum = 0; + pRule->totalDropLogNum = 0; } -const HiLogLimitRule* GetLogLimitRule(uint8 module) +const HiLogLimitRule *GetLogLimitRule(uint8 module) { if (module >= HILOG_MODULE_MAX) { return NULL; diff --git a/frameworks/mini/hiview_log_limit.h b/frameworks/mini/hiview_log_limit.h index aa5aee9edfb8c22f016ee39e1144dc3828278422..34b284f3938a13a7238e7d74fd36241fbd21057a 100755 --- a/frameworks/mini/hiview_log_limit.h +++ b/frameworks/mini/hiview_log_limit.h @@ -29,13 +29,13 @@ typedef struct { uint8 maxNum; /* the max num limit of log line */ uint8 logNum; uint16 baseTime; - uint32 totalLogNum; + uint32 totalDropLogNum; } HiLogLimitRule; void InitLogLimit(void); boolean LogIsLimited(uint8 module); void SetLimitThreshold(uint8 module, uint8 v); -const HiLogLimitRule* GetLogLimitRule(uint8 module); +const HiLogLimitRule *GetLogLimitRule(uint8 module); #ifdef __cplusplus #if __cplusplus