
Company News
Socket Named Top Sales Organization by RepVue
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.

Logan is a mini template system for the console and colors.
It allows to cleanly separate content from style and create beautiful logging functions.
Let's say you want to write a logging function that says hello.
// Without Logan
function hello(arg) {
console.log('Hello'.bold.green + ' : ' + arg.cyan);
}
// With Logan
var hello = logan.create('Hello : %', 'bold.green . cyan')
hello('world');

var logan = require('logan');
This is the most useful method of logan. It lets you define all your templates in one place.
logan.set({
info: ['info : %', 'yellow'],
warn: ['warn : %', 'orange'],
omg : ['omg : %', 'rainbow']
});
logan.info('some info');
Notice how easy it is to see what all your logging functions will output.
Also, with set your module users can easily theme logs:
// Overriding omg to be... more OMG!!!
logan.set({
omg: ['OMG : % !!!', 'red . . red']
});
Returns a logging function.
var info = logan.create('info : %', 'yellow');
info('some text');
Returns a function which returns a string when called.
var info = logan.compile('info : %', 'yellow');
console.log(info('some text'));
{} usage:
// for example, instead of writing this:
var green = logan.create('some long green string', 'green green green green');
// using {} you can write
var green = logan.create('{some long green string}', 'green');
If you want to suppress all output, during tests for example, just set silent to true.
logan.set({'foo', ['foo', 'red']});
logan.silent = true;
logan.foo(); // No output
logan.silent = false;
logan.foo(): // will output 'foo'
Since there's a templating engine called hogan and this one is about logging, it was called logan.
If you want to see how Logan can be used in another project, you can have a look at ShoutJS.
FAQs
Mini template system for the console and colors
The npm package logan receives a total of 10 weekly downloads. As such, logan popularity was classified as not popular.
We found that logan 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.

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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.