mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Added a "|", and minor log improvement
This commit is contained in:
@@ -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]
|
||||
}
|
||||
|
Reference in New Issue
Block a user