mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
Add more info to logged output
This commit is contained in:
parent
cfac880cf5
commit
ef865bea19
@ -703,14 +703,14 @@ function objectPrune(
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
objectPrune.logJson = (json, logLevel, reNeedle) => {
|
objectPrune.logJson = (json, msg, reNeedle) => {
|
||||||
if ( reNeedle.test(json) === false ) { return; }
|
if ( reNeedle.test(json) === false ) { return; }
|
||||||
safeSelf().uboLog(`objectPrune() log:${logLevel}`, location.hostname, json);
|
safeSelf().uboLog(`objectPrune()`, msg, location.hostname, json);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const jsonBefore = logLevel ? JSON.stringify(obj, null, 2) : '';
|
const jsonBefore = logLevel ? JSON.stringify(obj, null, 2) : '';
|
||||||
if ( logLevel === true || logLevel === 'all' ) {
|
if ( logLevel === true || logLevel === 'all' ) {
|
||||||
objectPrune.logJson(jsonBefore, logLevel, reLogNeedle);
|
objectPrune.logJson(jsonBefore, `prune:"${rawPrunePaths}" log:"${logLevel}"`, reLogNeedle);
|
||||||
}
|
}
|
||||||
if ( prunePaths.length === 0 ) { return; }
|
if ( prunePaths.length === 0 ) { return; }
|
||||||
let outcome = 'nomatch';
|
let outcome = 'nomatch';
|
||||||
@ -722,7 +722,7 @@ function objectPrune(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( logLevel === outcome ) {
|
if ( logLevel === outcome ) {
|
||||||
objectPrune.logJson(jsonBefore, logLevel, reLogNeedle);
|
objectPrune.logJson(jsonBefore, `prune:"${rawPrunePaths}" log:"${logLevel}"`, reLogNeedle);
|
||||||
}
|
}
|
||||||
if ( outcome === 'match' ) { return obj; }
|
if ( outcome === 'match' ) { return obj; }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user