@platform/log
Advanced tools
Comparing version 0.1.62 to 0.1.65
@@ -14,12 +14,11 @@ "use strict"; | ||
var color = function (color, items) { return toColorItem(color, items); }; | ||
var log = tslib_1.__assign({}, common_1.create({ color: color })); | ||
var formatter = operators_1.map(function (e) { | ||
switch (e.type) { | ||
case 'LOG': | ||
case 'GROUP': | ||
var output = format(e.payload); | ||
return tslib_1.__assign(tslib_1.__assign({}, e), { payload: tslib_1.__assign(tslib_1.__assign({}, e.payload), { output: output }) }); | ||
default: | ||
return e; | ||
var log = tslib_1.__assign({}, (0, common_1.create)({ color: color })); | ||
var formatter = (0, operators_1.map)(function (e) { | ||
if (e.type === 'LOG' || e.type === 'GROUP') { | ||
var output = format(e.payload); | ||
return tslib_1.__assign(tslib_1.__assign({}, e), { payload: tslib_1.__assign(tslib_1.__assign({}, e.payload), { output: output }) }); | ||
} | ||
else { | ||
return e; | ||
} | ||
}); | ||
@@ -33,7 +32,7 @@ log.events$ = log.events$.pipe(formatter); | ||
var events$ = exports.log.events$ | ||
.pipe(operators_1.filter(function () { return !exports.log.silent; })) | ||
.pipe(operators_1.filter(function () { return Boolean(global.console); })); | ||
.pipe((0, operators_1.filter)(function () { return !exports.log.silent; })) | ||
.pipe((0, operators_1.filter)(function () { return Boolean(global.console); })); | ||
events$ | ||
.pipe(operators_1.filter(function (e) { return e.type === 'LOG'; })) | ||
.pipe(operators_1.map(function (e) { return e.payload; })) | ||
.pipe((0, operators_1.filter)(function (e) { return e.type === 'LOG'; })) | ||
.pipe((0, operators_1.map)(function (e) { return e.payload; })) | ||
.subscribe(function (e) { | ||
@@ -44,10 +43,10 @@ var level = e.level, output = e.output; | ||
events$ | ||
.pipe(operators_1.filter(function (e) { return e.type === 'CLEAR'; })) | ||
.pipe((0, operators_1.filter)(function (e) { return e.type === 'CLEAR'; })) | ||
.subscribe(function (e) { return console.clear(); }); | ||
events$ | ||
.pipe(operators_1.filter(function (e) { return e.type === 'GROUP'; })) | ||
.pipe(operators_1.map(function (e) { return e.payload; })) | ||
.pipe((0, operators_1.filter)(function (e) { return e.type === 'GROUP'; })) | ||
.pipe((0, operators_1.map)(function (e) { return e.payload; })) | ||
.subscribe(function (e) { return console.group.apply(console, e.output); }); | ||
events$ | ||
.pipe(operators_1.filter(function (e) { return e.type === 'UNGROUP'; })) | ||
.pipe((0, operators_1.filter)(function (e) { return e.type === 'UNGROUP'; })) | ||
.subscribe(function (e) { return console.groupEnd(); }); | ||
@@ -71,4 +70,4 @@ var isColorItem = function (item) { return (item ? item.__IS_COLOR__ === '__LOG_COLOR__' : false); }; | ||
if (!colorsStopped && isSimpleValue(value)) { | ||
text.push(isColor ? "%c" + value : "%c" + item); | ||
colors.push(isColor ? "color:" + cssColor(item.color) + ";" : "color:black;"); | ||
text.push(isColor ? "%c".concat(value) : "%c".concat(item)); | ||
colors.push(isColor ? "color:".concat(cssColor(item.color), ";") : "color:black;"); | ||
} | ||
@@ -80,3 +79,3 @@ else { | ||
}); | ||
return tslib_1.__spreadArray(tslib_1.__spreadArray([text.join(' ')], colors), rest); | ||
return tslib_1.__spreadArray(tslib_1.__spreadArray([text.join(' ')], colors, true), rest, true); | ||
} | ||
@@ -83,0 +82,0 @@ function cssColor(color) { |
@@ -25,3 +25,3 @@ "use strict"; | ||
} | ||
return next('warn', tslib_1.__spreadArray(['TODO:'], items)); | ||
return next('warn', tslib_1.__spreadArray(['TODO:'], items, true)); | ||
}; | ||
@@ -53,3 +53,3 @@ var log = { | ||
return { | ||
events$: events$.pipe(operators_1.share()), | ||
events$: events$.pipe((0, operators_1.share)()), | ||
next: function (level, color, items) { | ||
@@ -56,0 +56,0 @@ var payload = { |
@@ -5,3 +5,3 @@ "use strict"; | ||
var ramda_1 = require("ramda"); | ||
var compact = function (value) { return ramda_1.pipe(ramda_1.reject(ramda_1.isNil), ramda_1.reject(ramda_1.isEmpty))(value); }; | ||
var compact = function (value) { return (0, ramda_1.pipe)((0, ramda_1.reject)(ramda_1.isNil), (0, ramda_1.reject)(ramda_1.isEmpty))(value); }; | ||
exports.compact = compact; |
@@ -18,3 +18,3 @@ "use strict"; | ||
server_1.log.error('error'); | ||
server_1.log.info("\ncolors:\n " + server_1.log.black('black') + "\n " + server_1.log.blue('blue') + "\n " + server_1.log.cyan('cyan') + "\n " + server_1.log.gray('gray') + "\n " + server_1.log.green('green') + "\n " + server_1.log.magenta('magenta') + "\n " + server_1.log.red('red') + "\n " + server_1.log.white('white') + "\n " + server_1.log.yellow('yellow') + "\n"); | ||
server_1.log.info("\ncolors:\n ".concat(server_1.log.black('black'), "\n ").concat(server_1.log.blue('blue'), "\n ").concat(server_1.log.cyan('cyan'), "\n ").concat(server_1.log.gray('gray'), "\n ").concat(server_1.log.green('green'), "\n ").concat(server_1.log.magenta('magenta'), "\n ").concat(server_1.log.red('red'), "\n ").concat(server_1.log.white('white'), "\n ").concat(server_1.log.yellow('yellow'), "\n")); | ||
server_1.log.info('object', { foo: 123, text: 'hello' }); | ||
@@ -21,0 +21,0 @@ server_1.log.info({ foo: 123, text: 'hello' }); |
@@ -12,12 +12,11 @@ "use strict"; | ||
var color = function (color, items) { return common_1.chalk[color](items); }; | ||
var log = tslib_1.__assign(tslib_1.__assign({}, common_1.create({ color: color })), { table: function (options) { return log_table_1.table(log, options); }, stripAnsi: function (text) { return util_ansi_1.stripAnsiColors(text); } }); | ||
var formatter = operators_1.map(function (e) { | ||
switch (e.type) { | ||
case 'LOG': | ||
case 'GROUP': | ||
var output = log_format_1.format(e.payload); | ||
return tslib_1.__assign(tslib_1.__assign({}, e), { payload: tslib_1.__assign(tslib_1.__assign({}, e.payload), { output: output }) }); | ||
default: | ||
return e; | ||
var log = tslib_1.__assign(tslib_1.__assign({}, (0, common_1.create)({ color: color })), { table: function (options) { return (0, log_table_1.table)(log, options); }, stripAnsi: function (text) { return (0, util_ansi_1.stripAnsiColors)(text); } }); | ||
var formatter = (0, operators_1.map)(function (e) { | ||
if (e.type === 'LOG' || e.type === 'GROUP') { | ||
var output = (0, log_format_1.format)(e.payload); | ||
return tslib_1.__assign(tslib_1.__assign({}, e), { payload: tslib_1.__assign(tslib_1.__assign({}, e.payload), { output: output }) }); | ||
} | ||
else { | ||
return e; | ||
} | ||
}); | ||
@@ -24,0 +23,0 @@ log.events$ = log.events$.pipe(formatter); |
@@ -13,3 +13,3 @@ "use strict"; | ||
if (typeof item === 'object') { | ||
return util_1.inspect(item, false, undefined, true); | ||
return (0, util_1.inspect)(item, false, undefined, true); | ||
} | ||
@@ -16,0 +16,0 @@ return item; |
@@ -6,18 +6,18 @@ "use strict"; | ||
var log_create_1 = require("./log.create"); | ||
exports.log = log_create_1.create(); | ||
exports.log = (0, log_create_1.create)(); | ||
exports.default = exports.log; | ||
var events$ = exports.log.events$.pipe(operators_1.filter(function () { return !exports.log.silent; })); | ||
var events$ = exports.log.events$.pipe((0, operators_1.filter)(function () { return !exports.log.silent; })); | ||
events$ | ||
.pipe(operators_1.filter(function (e) { return e.type === 'LOG'; })) | ||
.pipe(operators_1.map(function (e) { return e.payload; })) | ||
.pipe((0, operators_1.filter)(function (e) { return e.type === 'LOG'; })) | ||
.pipe((0, operators_1.map)(function (e) { return e.payload; })) | ||
.subscribe(function (e) { return console.log(e.output); }); | ||
events$ | ||
.pipe(operators_1.filter(function (e) { return e.type === 'CLEAR'; })) | ||
.pipe((0, operators_1.filter)(function (e) { return e.type === 'CLEAR'; })) | ||
.subscribe(function (e) { return console.clear(); }); | ||
events$ | ||
.pipe(operators_1.filter(function (e) { return e.type === 'GROUP'; })) | ||
.pipe(operators_1.map(function (e) { return e.payload; })) | ||
.pipe((0, operators_1.filter)(function (e) { return e.type === 'GROUP'; })) | ||
.pipe((0, operators_1.map)(function (e) { return e.payload; })) | ||
.subscribe(function (e) { return console.group(e.output); }); | ||
events$ | ||
.pipe(operators_1.filter(function (e) { return e.type === 'UNGROUP'; })) | ||
.pipe((0, operators_1.filter)(function (e) { return e.type === 'UNGROUP'; })) | ||
.subscribe(function (e) { return console.groupEnd(); }); |
@@ -29,3 +29,3 @@ "use strict"; | ||
var _a = options.head, head = _a === void 0 ? [] : _a, _b = options.colWidths, colWidths = _b === void 0 ? [] : _b; | ||
var args = { head: common_1.compact(head), colWidths: colWidths }; | ||
var args = { head: (0, common_1.compact)(head), colWidths: colWidths }; | ||
if (options.border === false) { | ||
@@ -32,0 +32,0 @@ args = tslib_1.__assign(tslib_1.__assign({}, args), { chars: DEFAULTS.BORDERLESS, style: { 'padding-left': 0, 'padding-right': 0 } }); |
{ | ||
"name": "@platform/log", | ||
"version": "0.1.62", | ||
"version": "0.1.65", | ||
"description": "Client and server logging.", | ||
@@ -18,9 +18,9 @@ "main": "lib/index", | ||
"dependencies": { | ||
"@platform/libs": "0.2.14", | ||
"chalk": "4.1.2", | ||
"cli-table": "0.3.6" | ||
"@platform/libs": "0.3.2", | ||
"chalk": "5.0.1", | ||
"cli-table": "0.3.11" | ||
}, | ||
"devDependencies": { | ||
"@platform/test": "0.2.10", | ||
"@platform/ts": "4.1.23" | ||
"@platform/test": "0.3.2", | ||
"@platform/ts": "4.7.7" | ||
}, | ||
@@ -27,0 +27,0 @@ "files": [ |
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
26322
44
683
+ Added@platform/libs@0.3.2(transitive)
+ Added@types/ramda@0.28.15(transitive)
+ Addedchalk@5.0.1(transitive)
+ Addedcli-table@0.3.11(transitive)
+ Addedramda@0.28.0(transitive)
+ Addedrxjs@7.5.6(transitive)
+ Addedtslib@2.8.1(transitive)
- Removed@platform/libs@0.2.14(transitive)
- Removed@types/ramda@0.27.44(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedchalk@4.1.2(transitive)
- Removedcli-table@0.3.6(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedramda@0.27.1(transitive)
- Removedrxjs@7.3.0(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removedtslib@2.1.0(transitive)
Updated@platform/libs@0.3.2
Updatedchalk@5.0.1
Updatedcli-table@0.3.11