Skip to content

Commit

Permalink
removed chalk and using jsr std format instead
Browse files Browse the repository at this point in the history
  • Loading branch information
mvelten committed Oct 25, 2024
1 parent b3854de commit 2210542
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 26 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
"@std/collections": "jsr:@std/collections@^1.0.9",
"@std/crypto": "jsr:@std/crypto@^1.0.3",
"@std/expect": "jsr:@std/expect@^1.0.4",
"@std/fmt": "jsr:@std/fmt@^1.0.3",
"@std/path": "jsr:@std/path@^1.0.6",
"@std/testing": "jsr:@std/testing@^1.0.3",
"@types/figlet": "npm:@types/figlet@^1.5.8",
"@types/lodash": "npm:@types/lodash@^4.17.9",
"@types/seedrandom": "npm:@types/seedrandom@^3.0.8",
"chalk": "npm:chalk@4",
"cli-progress": "npm:cli-progress@^3.12.0",
"commander": "npm:commander@^12.1.0",
"figlet": "npm:figlet@^1.7.0",
Expand Down
25 changes: 6 additions & 19 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/utils/logging/logUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import type { ILogFacility, ILogger } from '../../@types/index.ts';

import chalk from 'chalk';
import { blue, green, magenta, red, yellow } from '@std/fmt/colors';

const loggerMap: Record<string, ILogger> = {};

Expand All @@ -29,31 +29,31 @@ class Logger implements ILogger {
) {}

info(message: string) {
const msg = chalk.blue(`[INFO] ${this.name} :: ${message}`);
const msg = blue(`[INFO] ${this.name} :: ${message}`);
this.logger.log(msg);
this.infoMessages.push(msg);
}

success(message: string) {
const msg = chalk.green(`[SUCCESS] ${this.name} :: ${message}`);
const msg = green(`[SUCCESS] ${this.name} :: ${message}`);
this.logger.log(msg);
this.successMessages.push(msg);
}

warn(message: string) {
const msg = chalk.yellow(`[WARNING] ${this.name} :: ${message}`);
const msg = yellow(`[WARNING] ${this.name} :: ${message}`);
this.logger.warn(msg);
this.warnMessages.push(msg);
}

error(message: string) {
const msg = chalk.red(`[ERROR] ${this.name} :: ${message}`);
const msg = red(`[ERROR] ${this.name} :: ${message}`);
this.logger.error(msg);
this.errorMessages.push(message);
}

debug(message: string) {
const msg = chalk.magenta(`[DEBUG] ${this.name} :: ${message}`);
const msg = magenta(`[DEBUG] ${this.name} :: ${message}`);
if (this.verbose) {
this.logger.log(msg);
}
Expand Down

0 comments on commit 2210542

Please sign in to comment.