Stellar output statistics

This commit is contained in:
luwenpeng
2024-04-16 14:12:41 +08:00
parent 17f5d338de
commit d878849c3a
18 changed files with 485 additions and 30 deletions

View File

@@ -153,7 +153,8 @@ static int parse_config(struct log_config *config, const char *cfg_file)
fprintf(stderr, "config file %s missing log.file\n", cfg_file);
goto error_out;
}
strncpy(config->log_file, ptr, sizeof(config->log_file) - 1);
// skip ""
strncpy(config->log_file, ptr + 1, strlen(ptr) - 2);
}
// level
@@ -200,7 +201,7 @@ static int log_reopen()
new_fd = open(buff, O_WRONLY | O_APPEND | O_CREAT, 0644);
if (new_fd == -1)
{
fprintf(stderr, "open() \"%s\" failed, %s", buff, strerror(errno));
fprintf(stderr, "open() \"%s\" failed, %s\n", buff, strerror(errno));
return -1;
}