loglevel-plugin-prefix
Advanced tools
Comparing version 0.8.1 to 0.8.2
@@ -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'); |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62573
322
219