fix: use CSS color instead

This commit is contained in:
2026-03-21 00:52:39 +07:00 Unverified
parent 48bd9b9c96
commit e035746a0f
+12 -5
View File
@@ -1,3 +1,4 @@
import { feature } from "bun:bundle";
import { color, inspect } from "bun"; import { color, inspect } from "bun";
const colors = [ const colors = [
@@ -7,17 +8,23 @@ const colors = [
"blue", "blue",
"magenta", "magenta",
"cyan", "cyan",
"brightRed", "lime",
"brightGreen",
"brightBlue",
"brightMagenta",
"orange", "orange",
"violet",
"skyblue",
"pink", "pink",
"turquoise",
"gold", "gold",
"deepskyblue",
"springgreen",
]; ];
var i = 0; var i = 0;
if (!feature("API"))
console.log(
colors.map((c) => `${color(c, "ansi")}${c.slice(0, 1)}`).join("") +
color("lightgray", "ansi"),
);
export function createLogger() { export function createLogger() {
const start = Date.now(); const start = Date.now();
const col = color(colors[i], "ansi"); const col = color(colors[i], "ansi");