@poi/logger
Advanced tools
Comparing version 12.0.0-alpha.1 to 12.0.0-alpha.2
34
index.js
@@ -13,18 +13,18 @@ const chalk = require('chalk') | ||
log(...args) { | ||
console.log(...args) | ||
console.log( | ||
...args.map(arg => { | ||
return typeof arg === 'function' ? arg() : arg | ||
}) | ||
) | ||
} | ||
debug(title, ...args) { | ||
debug(...args) { | ||
if (!this.options.debug) { | ||
return | ||
} | ||
console.log( | ||
chalk.magenta('debug'), | ||
chalk.blue(title), | ||
...args.map(str => chalk.bold(str)) | ||
) | ||
this.log(chalk.magenta('debug'), ...args) | ||
} | ||
error(...args) { | ||
console.error(chalk.red(args.join(' '))) | ||
this.log(chalk.red('error'), ...args) | ||
process.exitCode = process.exitCode || 1 | ||
@@ -34,6 +34,22 @@ } | ||
success(...args) { | ||
console.log(chalk.green('success'), ...args) | ||
this.log(chalk.green('success'), ...args) | ||
} | ||
done(...args) { | ||
this.log( | ||
chalk.green(process.platform === 'win32' ? '√' : '✔'), | ||
...args.map(arg => chalk.bold(arg)) | ||
) | ||
} | ||
warn(...args) { | ||
this.log(chalk.yellow('warning'), ...args) | ||
process.exitCode = process.exitCode || 1 | ||
} | ||
tip(...args) { | ||
this.log(chalk.cyan('tip'), ...args) | ||
} | ||
} | ||
module.exports = new Logger() |
{ | ||
"name": "@poi/logger", | ||
"version": "12.0.0-alpha.1", | ||
"version": "12.0.0-alpha.2", | ||
"files": [ | ||
@@ -15,3 +15,3 @@ "index.js" | ||
"xo": false, | ||
"gitHead": "8747b20b3a882698d5683bd17cb22263a16e3c7b" | ||
"gitHead": "8f3cd911cb2c1e4bf779baa39cf02172aa2cac07" | ||
} |
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
2393
43