Add aaa-12 处理log相关模块文件中文注释编码

RCA:
SOL:
修改人:liangxia
检视人:
This commit is contained in:
liangxia 2019-08-29 15:41:04 +08:00
parent a9e2537777
commit cdd5435c4e
5 changed files with 19 additions and 19 deletions

View File

@ -24,7 +24,7 @@ ret_code log_rpc_exec(char* service_name, char* method_name, pointer input, int
}
/* 仅适用于以“key=value”方式保存的配置解析适用于log-sched.conf的解析 */
/* 仅适用于以“key=value”方式保存的配置解析适用于log-sched.conf的解析 */
ret_code cm_log_get_keyvalue_from_file(const char *file_str, const char *key_str, char *value_str, int value_len)
{
ret_code ret = RET_ERR;
@ -57,10 +57,10 @@ ret_code cm_log_get_keyvalue_from_file(const char *file_str, const char *key_str
pos = strstr(line, key_str);
if (pos != NULL)
{
/* 跳过key与value间的"=" */
/* 跳过key与value间的"=" */
strcpy(value_str, pos+strlen(key_str)+1);
/* 滤除掉段尾的回车换行 */
/* 滤除掉段尾的回车换行 */
if ('\n' == value_str[strlen(value_str)-1])
{
value_str[strlen(value_str)-1] = '\0';
@ -80,7 +80,7 @@ ret_code cm_log_get_keyvalue_from_file(const char *file_str, const char *key_str
}
/* 检查的文件存在本函数返回1否则本函数返回0 */
/* 检查的文件存在本函数返回1否则本函数返回0 */
int cm_log_check_file_is_exist(const char *file_str)
{
int is_exist = 0;
@ -91,7 +91,7 @@ int cm_log_check_file_is_exist(const char *file_str)
}
else
{
/* 如果文件存在access返回0不存在access返回-1 */
/* 如果文件存在access返回0不存在access返回-1 */
is_exist = ((access(file_str, 0) == 0) ? 1 : 0);
}
@ -99,7 +99,7 @@ int cm_log_check_file_is_exist(const char *file_str)
}
/* 适用于log-console.conf与log-pty.conf的解析 */
/* 适用于log-console.conf与log-pty.conf的解析 */
ret_code cm_log_get_module_from_file(const char *file_str, char *value_str, int value_len)
{
ret_code ret = RET_ERR;
@ -154,7 +154,7 @@ ret_code cm_log_get_module_from_file(const char *file_str, char *value_str, int
return ret;
}
/* 适用于log-console.conf与log-pty.conf的解析 */
/* 适用于log-console.conf与log-pty.conf的解析 */
ret_code cm_log_get_level_from_file(const char *file_str, u8 *value)
{
ret_code ret = RET_ERR;

View File

@ -38,9 +38,9 @@ static ret_code cm_get_log_file_elems(log_file_t *log_file_conf, int *err_no)
memset(log_file_conf, 0, sizeof(*log_file_conf));
/* level、path、is_compress、del_over_days暂未实现 */
/* level、path、is_compress、del_over_days暂未实现 */
/* 日志文件大小上限del_over_size */
/* 日志文件大小上限del_over_size */
memset(value, 0, MAX_LINE_SZ);
if (cm_log_get_keyvalue_from_file(CM_LOG_CONF_LOGFILE_FILE, LOG_CONF_KEY_FILE_MAX_SIZE_STR, value, sizeof(value)) == 0)
{

View File

@ -166,7 +166,7 @@ static ret_code cm_log_prase_host_from_str(char *const input_str, log_remote_hos
memset(tmp_str, 0, sizeof(tmp_str));
/* 提取日志等级 */
/* 提取日志等级 */
while (1)
{
pos2 = strstr(pos, ".=");
@ -202,7 +202,7 @@ static ret_code cm_log_prase_host_from_str(char *const input_str, log_remote_hos
}
ret_host->level = (u8)tmp_value;
/* 提取IP地址 */
/* 提取IP地址 */
pos = strstr(pos2, "@");
if (NULL == pos)
{
@ -230,7 +230,7 @@ static ret_code cm_log_prase_host_from_str(char *const input_str, log_remote_hos
strncpy(ret_host->host, pos, tmp_len);
/* 提取端口 */
/* 提取端口 */
pos2 ++;
pos = pos2;
pos2 = strstr(pos, ":");
@ -250,7 +250,7 @@ static ret_code cm_log_prase_host_from_str(char *const input_str, log_remote_hos
}
ret_host->port = (u16)tmp_value;
/* 提取日志存放格式 */
/* 提取日志存放格式 */
pos2++;
pos = pos2;
@ -415,7 +415,7 @@ static ret_code cm_log_getall_host_from_file(const char *file_str, log_remote_ho
if (hosts[cnt].host[0] == '\0')
{
/* 无效数据 */
/* 无效数据 */
memset(hosts+cnt, 0, sizeof(log_remote_host_x_t));
continue;
}

View File

@ -172,7 +172,7 @@ ret_code console_initial()
memset(ttyfile_str, 0, sizeof(ttyfile_str));
strncpy(ttyfile_str, pos, str_len);
/* 滤除掉段尾的回车换行 */
/* 滤除掉段尾的回车换行 */
if ('\n' == ttyfile_str[strlen(ttyfile_str)-1])
{
ttyfile_str[strlen(ttyfile_str)-1] = '\0';