color-logger
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -8,2 +8,3 @@ 'use strict'; | ||
const levelToColor = { | ||
n: '[N]', // no color | ||
v: '[35m[V]', // purple | ||
@@ -130,4 +131,5 @@ d: '[34m[D]', // blue | ||
const log = `${ color } [${ now }] [${ info }] ${ text.join(' ') }[0m`; | ||
const offColorLog = `[${ level.toUpperCase() }] [${ now }] [${ info }] ${ text.join(' ') }`; | ||
this._allLogs.push(log); | ||
this._allLogs.push(offColorLog); | ||
if (this._allLogs.length > 10000) this._allLogs.shift(); | ||
@@ -167,7 +169,7 @@ | ||
/** | ||
* display info(green) log. | ||
* display normal(no color) log. | ||
* @param {...*} msg - log message. | ||
* @returns {string} formatted log message. | ||
*/ | ||
i() { | ||
n() { | ||
for (var _len4 = arguments.length, msg = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { | ||
@@ -177,2 +179,15 @@ msg[_key4] = arguments[_key4]; | ||
return this._output.apply(this, ['n'].concat(msg)); | ||
} | ||
/** | ||
* display info(green) log. | ||
* @param {...*} msg - log message. | ||
* @returns {string} formatted log message. | ||
*/ | ||
i() { | ||
for (var _len5 = arguments.length, msg = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { | ||
msg[_key5] = arguments[_key5]; | ||
} | ||
return this._output.apply(this, ['i'].concat(msg)); | ||
@@ -187,4 +202,4 @@ } | ||
w() { | ||
for (var _len5 = arguments.length, msg = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { | ||
msg[_key5] = arguments[_key5]; | ||
for (var _len6 = arguments.length, msg = Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { | ||
msg[_key6] = arguments[_key6]; | ||
} | ||
@@ -201,4 +216,4 @@ | ||
e() { | ||
for (var _len6 = arguments.length, msg = Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { | ||
msg[_key6] = arguments[_key6]; | ||
for (var _len7 = arguments.length, msg = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { | ||
msg[_key7] = arguments[_key7]; | ||
} | ||
@@ -205,0 +220,0 @@ |
{ | ||
"name": "color-logger", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Colorful Logger", | ||
@@ -5,0 +5,0 @@ "author": "h13i32maru", |
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
8107
192