Added no log to logger

This commit is contained in:
mrfry 2022-03-23 18:03:56 +01:00
parent f5ad460e24
commit ea459d05e4
2 changed files with 24 additions and 2 deletions

View file

@ -113,6 +113,9 @@ function LogReq(
if (req.url.includes('lred')) {
dl += C('red')
}
if (!shouldLog(req.session.user.id, noLogIds)) {
return
}
let hostname
if (req.hostname) {
@ -221,10 +224,14 @@ function Load(): void {
setNoLogReadInterval()
}
function LogStat(url: string, hostname: string, userId: number | string): void {
const nolog = noLogIds.some((noLogId) => {
export function shouldLog(userId: string | number, nolog: string[]): boolean {
return nolog.some((noLogId) => {
return noLogId === userId.toString()
})
}
function LogStat(url: string, hostname: string, userId: number | string): void {
const nolog = shouldLog(userId, noLogIds)
if (nolog) {
return
}