mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-11 22:16:56 +03:00
write logfile logs earlier, shorten startup banner, add uptime to logfile (#1443)
Co-authored-by: CaCO3 <caco@ruinelli.ch>
This commit is contained in:
@@ -57,6 +57,10 @@
|
||||
|
||||
|
||||
function processLogLine(line, index, arr) {
|
||||
/* Make sure the whitespaces in the uptime field get persevered */
|
||||
uptimePart = line.slice(0, line.indexOf("]")).replace(/ /g, " ");
|
||||
line = uptimePart + line.slice(line.indexOf("]"))
|
||||
|
||||
if (line.includes("<WRN>")) {
|
||||
arr[index] = "<span style=\"color:#e83c00\">" + line + "</span>";
|
||||
}
|
||||
@@ -66,7 +70,10 @@
|
||||
else if (line.includes("<DBG>")) {
|
||||
arr[index] = "<span style=\"color:gray\">" + line + "</span>";
|
||||
}
|
||||
|
||||
else {
|
||||
arr[index] = line;
|
||||
}
|
||||
|
||||
arr[index] += "<br>";
|
||||
}
|
||||
|
||||
@@ -80,7 +87,8 @@
|
||||
return res.text();
|
||||
})
|
||||
.then((log) => {
|
||||
log = log.replace(/</g, "<").replace(/>/g, ">");
|
||||
log = log.replace(/</g, "<");
|
||||
log = log.replace(/>/g, ">");
|
||||
logArr = log.split("\n");
|
||||
logArr.forEach(processLogLine);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user