Skip to content

Commit

Permalink
feat(shared): add logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Jun 8, 2021
1 parent 45b1a35 commit 3bb12ba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/shared/src/node/index.ts
@@ -1 +1,2 @@
export * from "./logger";
export * from "../shared";
14 changes: 14 additions & 0 deletions packages/shared/src/node/logger.ts
@@ -0,0 +1,14 @@
import chalk from "chalk";
import ora from "ora";

export const load = (message: string, plugin = ""): ora.Ora =>
ora(`${plugin ? `${chalk.blue(`${plugin}: `)}` : ""}${message}`);

export const warn = (message: string, plugin = ""): ora.Ora =>
ora(`${plugin ? `${chalk.blue(`${plugin}: `)}` : ""}${message}`).warn();

export const error = (message: string, plugin = ""): ora.Ora =>
ora(`${plugin ? `${chalk.blue(`${plugin}: `)}` : ""}${message}`).fail();

export const success = (message: string, plugin = ""): ora.Ora =>
ora(`${plugin ? `${chalk.blue(`${plugin}: `)}` : ""}${message}`).succeed();

0 comments on commit 3bb12ba

Please sign in to comment.