@vladmandic/pilogger
Advanced tools
Comparing version 0.3.2 to 0.3.3
{ | ||
"name": "@vladmandic/pilogger", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "Simple Logger for NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "dist/pilogger.js", |
@@ -38,2 +38,3 @@ const os = require('os'); | ||
fatal: ctx.bold.red('FATAL:'), | ||
assert: ctx.italic.bold.red('ASSERT:'), | ||
timed: ctx.magentaBright('TIMED:'), | ||
@@ -120,2 +121,6 @@ state: ctx.magenta('STATE:'), | ||
async function assert(res, exp, ...messages) { | ||
if (res !== exp) log('assert', ...messages, { res, exp }); | ||
} | ||
async function timed(t0, ...messages) { | ||
@@ -228,2 +233,3 @@ if (arguments.length < 2) { | ||
exports.timed = timed; // log with timing | ||
exports.assert = assert; // log if assertion failed | ||
exports.blank = (...message) => log(...message); | ||
@@ -230,0 +236,0 @@ exports.info = (...message) => log('info', ...message); |
@@ -33,1 +33,5 @@ const fs = require('fs'); | ||
log.debug('debug'); | ||
log.assert(1, 1, 'assert pass'); | ||
// @ts-ignore | ||
log.assert(1, 0, 'assert failed'); |
Sorry, the diff of this file is too big to display
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
84438
2230