fix log format
This commit is contained in:
+12
-4
@@ -114,7 +114,12 @@ router.get(
|
|||||||
if (index === 'attacker_id')
|
if (index === 'attacker_id')
|
||||||
data[requestIndex].username = e.attacker_name
|
data[requestIndex].username = e.attacker_name
|
||||||
if (index === 'servername') data[requestIndex].host = e.host
|
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 =
|
data[requestIndex].deaths_while_equipped =
|
||||||
Number(e.deaths_with_weapon) +
|
Number(e.deaths_with_weapon) +
|
||||||
(data[requestIndex].deaths_while_equipped || 0)
|
(data[requestIndex].deaths_while_equipped || 0)
|
||||||
@@ -127,9 +132,12 @@ router.get(
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
console.log(
|
console.log(
|
||||||
'Data calculation finished. Took + ' +
|
new Date().toLocaleString() + ',' +
|
||||||
Math.abs(new Date().getTime() - timeStart.getTime()) / 1000 +
|
(req.headers['x-forwarded-for']?.toString() ||
|
||||||
' seconds'
|
req.socket.remoteAddress?.toString() ||
|
||||||
|
'') +
|
||||||
|
',' +
|
||||||
|
Math.abs(new Date().getTime() - timeStart.getTime()) / 1000
|
||||||
)
|
)
|
||||||
res.status(200).send(data)
|
res.status(200).send(data)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user