Replies: 2 comments
-
|
Looking for a solution as well |
Beta Was this translation helpful? Give feedback.
-
|
After spending far too much time digging through AFFiNE logging, looks like there isn't any great option for supressing logs. The customary environment variables incl My rather unsatisfactory solution was to create a const ANSI_RE = /\x1b\[[0-9;]*m/g;
const shouldSuppress = (chunk) => {
const raw = typeof chunk === 'string' ? chunk : chunk.toString('utf8');
// NestJS text format: strip ANSI codes first, then match level keyword
const line = raw.replace(ANSI_RE, '');
return / (LOG|DEBUG|VERBOSE) /.test(line);
};
const _stdout = process.stdout.write.bind(process.stdout);
process.stdout.write = (chunk, ...args) =>
shouldSuppress(chunk) ? true : _stdout(chunk, ...args);
const _stderr = process.stderr.write.bind(process.stderr);
process.stderr.write = (chunk, ...args) =>
shouldSuppress(chunk) ? true : _stderr(chunk, ...args);and then including it in the Native/bare-metal: Docker: add |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I managed to setup affine with docker successfully but it keeps spamming DEBUG and VERBOSE messages.
Is there a way to change the log level?
Beta Was this translation helpful? Give feedback.
All reactions