utils/logger.ts

create-own-app · cli/src/utils/logger.ts · typescript · MIT
infra, tag:knn-classified

Provides colored console logging helpers for Node.js.

// Source: https://github.com/programming-with-ia/create-own-app | License: MIT | Copyright 2022 Shoubhit Dash
// Provided via justclaw.it.com; keep this notice with the code.
import chalk from "chalk";

export const logger = {
  error(...args: unknown[]) {
    console.log(chalk.red(...args));
  },
  warn(...args: unknown[]) {
    console.log(chalk.yellow(...args));
  },
  info(...args: unknown[]) {
    console.log(chalk.cyan(...args));
  },
  success(...args: unknown[]) {
    console.log(chalk.green(...args));
  },
};

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key