Added a "|", and minor log improvement

This commit is contained in:
MrFry 2019-10-12 12:05:40 +02:00
parent a2e4091c94
commit 75655e4ea5
2 changed files with 3 additions and 7 deletions

View file

@ -70,7 +70,7 @@ function LogReq (req, toFile, sc) {
logEntry += dl + req.hostname + dl + req.headers['user-agent'] + dl + req.method + dl
logEntry += req.url
logEntry += C(GetRandomColor(ip)) + req.url
if (sc !== undefined && sc === 404) { logEntry += dl + sc }
@ -95,11 +95,7 @@ function GetRandomColor (ip) {
}
let res = ip.split('').reduce((res, x) => {
if (!isNaN(x)) {
return res + parseInt(x)
} else {
return res
}
return res + x.charCodeAt(0)
}, 0)
return colors[res % colors.length]
}