Skip to content

Instantly share code, notes, and snippets.

@imroca
Last active February 9, 2024 22:39
Show Gist options
  • Save imroca/e8f94470676ac093f44e77b8cbdc8e1f to your computer and use it in GitHub Desktop.
Save imroca/e8f94470676ac093f44e77b8cbdc8e1f to your computer and use it in GitHub Desktop.
Small logging utilities setup.
import pc from "picocolors";
// Assign colors.
export const success = pc.green;
export const ok = pc.green;
export const info = pc.cyan;
export const msg = pc.blue;
export const message = pc.blue;
export const notice = pc.magenta;
export const spam = pc.gray;
export const whisper = (msg) => pc.gray(pc.dim(msg));
export const debug = pc.white;
export const warning = pc.yellow;
export const warn = pc.yellow;
export const error = pc.red;
export const critical = (msg) => pc.red(pc.bold(msg));
export const crit = critical;
export const bold = pc.bold;
export const dim = pc.dim;
export const log = console.log;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment