MCPcopy Index your code
hub / github.com/ClearURLs/Addon / pushToLog

Function pushToLog

core_js/tools.js:288–306  ·  view source on GitHub ↗

* Function to log all activities from ClearUrls. * Only logging when activated. * * @param beforeProcessing the url before the clear process * @param afterProcessing the url after the clear process * @param rule the rule that triggered the process

(beforeProcessing, afterProcessing, rule)

Source from the content-addressed store, hash-verified

286 * @param rule the rule that triggered the process
287 */
288function pushToLog(beforeProcessing, afterProcessing, rule) {
289 const limit = Math.max(0, storage.logLimit);
290 if (storage.loggingStatus && limit !== 0 && !isNaN(limit)) {
291 while (storage.log.log.length >= limit
292 || storage.log.log.length >= logThreshold) {
293 storage.log.log.shift();
294 }
295
296 storage.log.log.push(
297 {
298 "before": beforeProcessing,
299 "after": afterProcessing,
300 "rule": rule,
301 "timestamp": Date.now()
302 }
303 );
304 deferSaveOnDisk('log');
305 }
306}
307
308/**
309 * Checks if the storage is available.

Callers 3

removeFieldsFormURLFunction · 0.85
clearUrlFunction · 0.85
eTagFilterFunction · 0.85

Calls 1

deferSaveOnDiskFunction · 0.85

Tested by

no test coverage detected