diff --git a/src/index.js b/src/index.js index 2d51f32..823ee2f 100644 --- a/src/index.js +++ b/src/index.js @@ -6,7 +6,7 @@ var util = require('util') , fs = require('fs'); var APP_NAME = "Mus.ec"; -var LOG_PATH = "./scribe"; +var LOG_PATH = "./.."; var MAIN_USER = "root"; // Logger information which will be read by the 'overload' function when @@ -230,11 +230,16 @@ var getlog = function(req, res) { } var type = req.param('type'); - type = type ? type : "log"; + var raw = req.param('raw'); var contents = "No log found"; + + raw = raw ? true : false; + type = type ? type : "log"; + fs.readFile(LOG_PATH + "/log/" + date + "/" + MAIN_USER + "/app." + type, 'utf8', function(err, data) { if (!err) contents = data; - // contents = contents.replace(/^(.*?)#\|#/mg, '$1#\|#') + if(raw) return res.send("
" + contents + "
");
+
contents = contents.replace(/ /g, ' ')
contents = contents.replace(regA, '$1$2');
contents = contents.replace(regB, '$1$2$3');