@ulixee/commons
Advanced tools
Comparing version 2.0.0-alpha.4 to 2.0.0-alpha.5
@@ -196,25 +196,2 @@ "use strict"; | ||
exports.registerNamespaceMapping = registerNamespaceMapping; | ||
registerNamespaceMapping((ns, active, skip) => { | ||
if (ns.includes('ubk:*') || ns.includes('ubk*')) { | ||
active.push(/agent\/.*/); | ||
} | ||
else if (ns === 'ubk') { | ||
active.push(/agent\/.*/); | ||
skip.push(/DevtoolsSessionLogger/, /agent\/mitm.*/); | ||
} | ||
else if (ns.includes('ubk:devtools')) { | ||
active.push(/DevtoolsSessionLogger/); | ||
} | ||
}); | ||
registerNamespaceMapping((ns, active) => { | ||
if (ns.includes('ulx:*') || ns.includes('ulx*')) { | ||
active.push(/^apps\/chromealive*/, /hero\/.*/, /net\/.*/, /databox\/.*/); | ||
} | ||
else if (ns.includes('hero')) { | ||
active.push(/^hero\/.*/, /net\/.*/); | ||
} | ||
else if (ns.includes('databox')) { | ||
active.push(/^databox\/.*/, /net\/.*/); | ||
} | ||
}); | ||
function isEnabled(modulePath) { | ||
@@ -243,12 +220,10 @@ if (modulePath in logFilters.enabledNamesCache) | ||
const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); | ||
for (let part of split) { | ||
for (const part of split) { | ||
if (!part) | ||
continue; | ||
part = part.replace(/\*/g, '.*?'); | ||
if (part[0] === '-') { | ||
logFilters.namespaces.inactive.add(part); // .push(new RegExp('^' + part.slice(1) + '$')); | ||
logFilters.namespaces.inactive.add(part); | ||
} | ||
else { | ||
logFilters.namespaces.active.add(part); | ||
// logFilters.active.push(new RegExp('^' + part + '$')); | ||
} | ||
@@ -258,2 +233,25 @@ } | ||
enable(process.env.DEBUG); | ||
registerNamespaceMapping((ns, active, skip) => { | ||
if (ns.includes('ubk:*') || ns.includes('ubk*')) { | ||
active.push(/agent\/.*/); | ||
} | ||
else if (ns === 'ubk') { | ||
active.push(/agent\/.*/); | ||
skip.push(/DevtoolsSessionLogger/, /agent\/mitm.*/); | ||
} | ||
else if (ns.includes('ubk:devtools')) { | ||
active.push(/DevtoolsSessionLogger/); | ||
} | ||
}); | ||
registerNamespaceMapping((ns, active) => { | ||
if (ns.includes('ulx:*') || ns.includes('ulx*')) { | ||
active.push(/^apps\/chromealive*/, /hero\/.*/, /net\/.*/, /databox\/.*/); | ||
} | ||
else if (ns.includes('hero')) { | ||
active.push(/^hero\/.*/, /net\/.*/); | ||
} | ||
else if (ns.includes('databox')) { | ||
active.push(/^databox\/.*/, /net\/.*/); | ||
} | ||
}); | ||
//# sourceMappingURL=Logger.js.map |
{ | ||
"name": "@ulixee/commons", | ||
"version": "2.0.0-alpha.4", | ||
"version": "2.0.0-alpha.5", | ||
"description": "Common utilities for Ulixee", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
197136
2844