Merge pull request #1233 from bbassie/chore/drop-chalk

Replace chalk with util.styleText
This commit is contained in:
Bastiaan authored and GitHub committed 2026-11-20 20:54:30 +00:00
1 parent bd41801c8d
commit 81c7d24867
5 files changed
+12 -19

No files matched your search

+2 -5
View File
@@ -1,5 +1,5 @@
/* eslint-disable no-console */
import chalk from "chalk";
import { styleText } from "node:util";
export const levels = Object.freeze({
fatal: 0,
@@ -27,10 +27,7 @@ for (let [name, level] of Object.entries(levels)) {
if (level > maxLogLevel) {
return;
}
let style = chalk;
for (let part of colors[name].split(" ")) {
style = style[part];
}
const style = text => styleText(colors[name].split(" "), text);
if (["fatal", "error"].includes(name)) {
console.error(`${style(name)} ${message}`);
} else if (["warn"].includes(name)) {