fix(ui): fix logger filter

was accidetnally replacing the filter instead of appending to it.
This commit is contained in:
psychedelicious 2024-08-20 21:01:07 +10:00
parent d3cdcef36b
commit 56d450a907

View File

@ -20,8 +20,7 @@ export const useLogger = (namespace: LogNamespace) => {
// Use a filter to show only logs of the given level // Use a filter to show only logs of the given level
let filter = `context.logLevel:>=${LOG_LEVEL_MAP[logLevel]}`; let filter = `context.logLevel:>=${LOG_LEVEL_MAP[logLevel]}`;
if (logNamespaces.length > 0) { if (logNamespaces.length > 0) {
filter += ' AND '; filter += ` AND (${logNamespaces.map((ns) => `context.namespace:${ns}`).join(' OR ')})`;
filter = `(${logNamespaces.map((ns) => `context.namespace:${ns}`).join(' OR ')})`;
} else { } else {
filter += ' AND context.namespace:undefined'; filter += ' AND context.namespace:undefined';
} }