
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
A simple, lightweight utility for making beautiful logs.
console.log
npm i --save cat-loggr
// JavaScript:
const CatLoggr = require('cat-loggr');
// TypeScript:
import CatLoggr from 'cat-loggr/ts';
const loggr = new CatLoggr();
loggr.log('Hello, world!');
That's it!
If defined, the info level is default. If not, the lowest priority level is default.
const loggr = new CatLoggr({
levels: [
{ name: 'catnip', color: CatLoggr._chalk.red.bgBlack },
{ name: 'fish', color: CatLoggr._chalk.black.bgRed }
]
});
// OR
const loggr = new CatLoggr()
.setLevels([
{ name: 'catnip', color: CatLoggr._chalk.red.bgBlack },
{ name: 'fish', color: CatLoggr._chalk.black.bgRed }
]);
loggr.fish('Delicious!');
const loggr = new CatLoggr({
level: 'warn'
});
// OR
const loggr = new CatLoggr()
.setLevel('warn');
loggr.info('This will not display,');
loggr.warn('but this will!');
const loggr = new CatLoggr();
let obj = {
with: {
depth: {
fun: '!'
}
}
};
loggr.log(obj);
// { with: { depth: [Object] } }
loggr.meta({depth: 2}).log(obj);
// { with: { depth: { fun: '!' } } }
You can define hook for extra argument processing.
If the hook callback returns null or undefined, the processing for that argument will continue. Otherwise, it will cease if an actual value is returned.
Returned values will be added to the log's output. If an array is returned, each element of the array will be added individually.
class Cat {}
const cat = new Cat();
const loggr = new CatLoggr()
.addArgHook(function({ arg, date }) {
if (arg instanceof Cat)
return 'kitty!';
});
loggr.log(cat);
// kitty!
You can also define hooks for post processing.
const loggr = new CatLoggr()
.addPostHook(function({ text }) {
return 'Hello, ' + text;
});
loggr.log('world!');
// Hello, world!
If you want to go full meme, you can make CatLoggr overwrite the global console object! Use responsibly.
const loggr = new CatLoggr()
.setGlobal();
console.log('Hello, world!');
FAQs
A utility to make beautiful console logs easily.
The npm package cat-loggr receives a total of 390 weekly downloads. As such, cat-loggr popularity was classified as not popular.
We found that cat-loggr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.