libmodulor
Version:
A TypeScript library to create platform-agnostic applications
11 lines (10 loc) • 461 B
JavaScript
import { ERR_LOGGER_LEVEL } from './consts.js';
export function assertLoggerLevel(loggerLevel) {
if (loggerLevel === 'error') {
return;
}
// Depending on the `Logger` implementation, this.logger.error() might not write to stderr (e.g. can write to a file).
// That's why we explicitly write to stdout by calling console.error().
// biome-ignore lint/suspicious/noConsole: we want it
console.error(new Error(ERR_LOGGER_LEVEL));
}