Tarsier is intended to be fast, highly customizable and just pretty.
If you need a more complex JSON logger, you should check out pino instead.
Tarsier was highly inspired by Signale, which still might be a better option for you.
npm i -D @jliocsar/tarsier
yarn add -D @jliocsar/tarsier
pnpm add -D @jliocsar/tarsier
bun add -D @jliocsar/tarsier
import { tarsier, Color } from "@jliocsar/tarsier";
const logger = tarsier({
types: {
santa: {
level: "info",
prefix: "π
",
color: {
foreground: Color.Foreground.Red,
style: Color.Style.Bold,
},
},
grinch: {
level: "warn",
prefix: "π",
color: {
foreground: Color.Foreground.Green,
style: [Color.Style.Strikethrough, Color.Style.Italic],
},
},
},
});
logger.error(new Error("Something went wrong here!"));
logger.info("Santa is coming to town!");
logger.santa("Ho ho ho!");
logger.grinch("I hate Christmas!");