MCPcopy Index your code
hub / github.com/Threadfin/Threadfin / writeLogInDiv

Function writeLogInDiv

html/js/log.js:12–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10}
11
12function writeLogInDiv() {
13 var logs = log["log"];
14 var div = document.getElementById("settings").lastChild.lastChild;
15 div.innerHTML = "";
16
17 var max = 50;
18
19
20 for (var i = 0; i < logs.length; i++) {
21 var newEntry = new Object();
22 newEntry["_element"] = "P";
23
24 if (logs[i].includes("ERROR")) {
25 // case "warnings": msgType = "warningMsg"; break;
26 newEntry["class"] = "errorMsg";
27 }
28
29 if (logs[i].includes("WARNING")) {
30 // case "warnings": msgType = "warningMsg"; break;
31 newEntry["class"] = "warningMsg";
32 }
33
34 newEntry["_text"] = logs[i];
35
36 div.appendChild(createElement(newEntry));
37 }
38
39 calculateWrapperHeight();
40 var scrollDiv = document.getElementById("box-wrapper");
41 scrollDiv.scrollTop = scrollDiv.scrollHeight;
42}
43
44function showLog(obj) {
45 //logInterval = setInterval(updateLog, 5000);

Callers 3

updateLogFunction · 0.85
showLogFunction · 0.85
ThreadfinFunction · 0.85

Calls 2

createElementFunction · 0.85
calculateWrapperHeightFunction · 0.85

Tested by

no test coverage detected