From 9a7797ce20b790ab610fc553cb5f04e6455aa737 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Thu, 30 Mar 2023 20:46:53 +0100 Subject: [PATCH] Adjust order of log function to reduce unneccesary things --- js/lib.main.js | 3 +-- js/stat.js | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/js/lib.main.js b/js/lib.main.js index a218f76..c1d9e0d 100644 --- a/js/lib.main.js +++ b/js/lib.main.js @@ -33,15 +33,14 @@ const delay = ms => new Promise(res => setTimeout(res, ms)); /* Log Helper */ -/* Values for level: 1, 2, 3 */ /* Maintains backwards compatibility for previous implementation of log helper */ async function log(msg, type) { - var time = new Date().toISOString(); const mode = "prod" if (mode === "prod" && type != "ERR") { return; } + var time = new Date().toISOString(); switch (type) { case "ERR": console.error(`${time} - ${msg}`); diff --git a/js/stat.js b/js/stat.js index 7b625b4..da34811 100644 --- a/js/stat.js +++ b/js/stat.js @@ -11,13 +11,11 @@ async function get() { } async function display(data) { - console.log(JSON.stringify(data)) document.getElementById('server_host').textContent = data.host; document.getElementById('server_mode').textContent = data.mode || "Unknown"; document.getElementById('ver-bkend').textContent = data.verBkend || "Unknown"; let dat = data.dat[0] let ver = data.ver[0] - console.log(JSON.stringify(dat)) document.getElementById('time').textContent = await convertUnixLocal(dat.since); document.getElementById('ldbws').textContent = dat.ldbws || "0"; document.getElementById('ldbsvws').textContent = dat.ldbsvws || "0";