Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

loglevel-plugin-prefix

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loglevel-plugin-prefix - npm Package Compare versions

Comparing version 0.8.1 to 0.8.2

10

examples/node.js

@@ -20,11 +20,9 @@ // eslint-disable-next-line import/no-extraneous-dependencies

format(level, name, timestamp) {
return `${chalk.gray(`[${timestamp}]`)} ${colors[level.toUpperCase()](level)} ${chalk.green(`(${name}):`)}`;
return `${chalk.gray(`[${timestamp}]`)} ${colors[level.toUpperCase()](level)} ${chalk.green(`${name}:`)}`;
},
});
const critical = log.getLogger('critical');
prefix.apply(critical, {
prefix.apply(log.getLogger('critical'), {
format(level, name, timestamp) {
return chalk.red.bold(`[${timestamp}] ${level} (${name}):`);
return chalk.red.bold(`[${timestamp}] ${level} ${name}:`);
},

@@ -35,3 +33,3 @@ });

log.debug('debug');
critical.info('Something significant happened');
log.getLogger('critical').info('Something significant happened');
log.log('log');

@@ -38,0 +36,0 @@ log.info('info');

4

package.json

@@ -27,3 +27,3 @@ {

"license": "MIT",
"version": "0.8.1",
"version": "0.8.2",
"main": "./lib/loglevel-plugin-prefix",

@@ -50,2 +50,2 @@ "scripts": {

}
}
}

@@ -103,11 +103,9 @@ # loglevel-plugin-prefix

format(level, name, timestamp) {
return `${chalk.gray(`[${timestamp}]`)} ${colors[level.toUpperCase()](level)} ${chalk.green(`(${name}):`)}`;
return `${chalk.gray(`[${timestamp}]`)} ${colors[level.toUpperCase()](level)} ${chalk.green(`${name}:`)}`;
},
});
const critical = log.getLogger('critical');
prefix.apply(critical, {
prefix.apply(log.getLogger('critical'), {
format(level, name, timestamp) {
return chalk.red.bold(`[${timestamp}] ${level} (${name}):`);
return chalk.red.bold(`[${timestamp}] ${level} ${name}:`);
},

@@ -118,3 +116,3 @@ });

log.debug('debug');
critical.info('Something significant happened');
log.getLogger('critical').info('Something significant happened');
log.log('log');

@@ -127,2 +125,3 @@ log.info('info');

Output
![output](https://raw.githubusercontent.com/kutuluk/loglevel-plugin-prefix/master/colored.png "output")

@@ -129,0 +128,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc