From 4ee97b1f7312d8406f56a514bb2d1ab3636395fa Mon Sep 17 00:00:00 2001 From: lefteris Date: Fri, 23 Apr 2021 17:21:53 +0300 Subject: [PATCH] error + out collorizing --- swarmlab-app/src/run/app.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index a2bd5f64..fa99f476 100644 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -98,7 +98,7 @@ const corsOptions = { // ------------------------------ // Lefos - get length of logs app.get("/length", cors(corsOptions), (req, res) => { - console.log("getting length of logs"); + console.error("getting length of logs"); var url = "mongodb://mongo:27017/"; @@ -217,7 +217,13 @@ app.get("/test2", cors(corsOptions), (req, res) => { obj.forEach((value) => { if (value.log.includes("app_name")) { - jsonfinal.push(JSON.parse(value.log)); + var tmp = JSON.parse(value.log); + if (tmp.type == "out") { + tmp.type = '
' + tmp.type + "
"; + } else if (tmp.type == "err") { + tmp.type = '
' + tmp.type + "
"; + } + jsonfinal.push(tmp); } }); //console.log("Sending Data: " + jsonfinal);