mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-21 08:03:13 +09:00
Merge pull request #1233 from bbassie/chore/drop-chalk
Replace chalk with util.styleText
This commit is contained in:
1 parent
bd41801c8d
commit
81c7d24867
5 files changed
+12
-19
No files matched your search
@@ -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)) {
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
"@inquirer/confirm": "^6.3.5",
|
||||
"@inquirer/input": "^5.1.9",
|
||||
"@inquirer/select": "^5.2.8",
|
||||
"chalk": "catalog:",
|
||||
"yargs": "catalog:"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user