Skip to content

Commit 02f17e8

Browse files
committed
fix: add colors for the logger
1 parent de75c05 commit 02f17e8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/logger.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ class Logger {
1919

2020
error(...args: unknown[]) {
2121
if (this.level >= 0) {
22-
console.error("[ERROR cmake-ts]", ...args)
22+
console.error("\x1b[31m[ERROR cmake-ts]\x1b[0m", ...args)
2323
}
2424
}
2525

2626
warn(...args: unknown[]) {
2727
if (this.level >= 1) {
28-
console.warn("[WARN cmake-ts]", ...args)
28+
console.warn("\x1b[33m[WARN cmake-ts]\x1b[0m", ...args)
2929
}
3030
}
3131

3232
info(...args: unknown[]) {
3333
if (this.level >= 2) {
34-
console.info("[INFO cmake-ts]", ...args)
34+
console.info("\x1b[32m[INFO cmake-ts]\x1b[0m", ...args)
3535
}
3636
}
3737

@@ -41,13 +41,13 @@ class Logger {
4141

4242
debug(...args: unknown[]) {
4343
if (this.level >= 3) {
44-
console.debug("[DEBUG cmake-ts]", ...args, { level: this.level })
44+
console.debug("\x1b[34m[DEBUG cmake-ts]\x1b[0m", ...args, { level: this.level })
4545
}
4646
}
4747

4848
trace(...args: unknown[]) {
4949
if (this.level >= 4) {
50-
console.trace("[TRACE cmake-ts]", ...args)
50+
console.trace("\x1b[34m[TRACE cmake-ts]\x1b[0m", ...args)
5151
}
5252
}
5353
}

0 commit comments

Comments
 (0)