一开始就显示日志

This commit is contained in:
zogodo
2020-02-16 19:51:40 +08:00
parent 90cf43c6eb
commit 26814c015a
5 changed files with 6 additions and 4 deletions

View File

@@ -510,6 +510,7 @@ function GetSysLog() {
log_div.scrollTo(0, log_div.scrollHeight);
});
}
GetSysLog();
function GetTimedTask() {
HttpGet("/task", function (re) {

File diff suppressed because one or more lines are too long

View File

@@ -29,13 +29,13 @@ char* GetLogRecord()
int i = log_record.idx - LOG_NUM + 1;
i = i < 0 ? 0 : i;
char* tmp = log_record_str;
sprintf(tmp, "%d\n", log_record.idx);
for (; i <= log_record.idx; i++)
{
tmp += strlen(tmp);
if (!log_record.logs[i%LOG_NUM]) continue;
sprintf(tmp, "%s\n", log_record.logs[i%LOG_NUM]);
tmp += strlen(tmp);
}
sprintf(tmp, "%d", log_record.idx);
return log_record_str;
}