fix: http log spam

This commit is contained in:
Isaac 2023-03-11 00:14:24 +00:00
parent be7f431746
commit 788f0fee05
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33

View File

@ -124,7 +124,7 @@ module.exports = async client => {
: responseTime >= 5 : responseTime >= 5
? '&e' ? '&e'
: '&a') + responseTime + 'ms'; : '&a') + responseTime + 'ms';
const level = req.routerPath.startsWith('/settings') ? 'verbose' : 'info'; const level = req.routerPath === '/*' ? 'verbose' : 'info';
client.log[level].http(short(`${req.id} ${req.ip} ${req.method} ${req.routerPath ?? '*'} &m-+>&r ${status}&b in ${responseTime}`)); client.log[level].http(short(`${req.id} ${req.ip} ${req.method} ${req.routerPath ?? '*'} &m-+>&r ${status}&b in ${responseTime}`));
if (!req.routerPath) client.log.verbose.http(`${req.id} ${req.method} ${req.url}`); if (!req.routerPath) client.log.verbose.http(`${req.id} ${req.method} ${req.url}`);
done(); done();