fix log format

This commit is contained in:
2023-04-21 12:33:31 +02:00
parent c1d5b6a05a
commit dd0a549ba4
+12 -4
View File
@@ -114,7 +114,12 @@ router.get(
if (index === 'attacker_id')
data[requestIndex].username = e.attacker_name
if (index === 'servername') data[requestIndex].host = e.host
if (index === 'cause_of_death' || (req.query.weapon && !req.query.weapon.toString().startsWith('!') && index === 'attacker_id'))
if (
index === 'cause_of_death' ||
(req.query.weapon &&
!req.query.weapon.toString().startsWith('!') &&
index === 'attacker_id')
)
data[requestIndex].deaths_while_equipped =
Number(e.deaths_with_weapon) +
(data[requestIndex].deaths_while_equipped || 0)
@@ -127,9 +132,12 @@ router.get(
)
})
console.log(
'Data calculation finished. Took + ' +
Math.abs(new Date().getTime() - timeStart.getTime()) / 1000 +
' seconds'
new Date().toLocaleString() + ',' +
(req.headers['x-forwarded-for']?.toString() ||
req.socket.remoteAddress?.toString() ||
'') +
',' +
Math.abs(new Date().getTime() - timeStart.getTime()) / 1000
)
res.status(200).send(data)
}