addLogging =========
npm install @alu0101163970/addloggingaddLogging
=========
The function addLogging() insert after an function entering a console.log() function describing the entering function.
## Installation
npm i @alu0101163970/addlogging --save
## Usage
* import:
const { addLogging } = require('addloging')
* Call function and parameters:
``js
let code = function foo(a, b) {
var x = 'blah';
var y = (function (z) {
return z+3;
})(2);
}
foo(1, 'wut', 3);
addLoggin(code);
/////////////////////////////////////
let code = function foo(a, b) {
var x = 'blah';
var y = (function (z) {
return z+3;
})(2);
}
foo(1, 'wut', 3);
let pattern = 'foo';
addLoggin(code, pattern);
`
it returns at first case:
`jsEntering foo(${ a },${ b }) at line 1
"function foo(a, b) {
console.log();Entering
var x = 'blah';
var y = (z => {
console.log();
return z + 3;
})(2);
}
foo(1, 'wut', 3);"
`
it returns at second case:
`jsEntering foo(${ a },${ b }) at line 1
function foo(a, b) {
console.log();``
var x = 'blah';
var y = (z => {
return z + 3;
})(2);
}
foo(1, 'wut', 3);
npm test
In lieu of a formal styleguide, take care to maintain the existing coding style.
Add unit tests for any new or changed functionality. Lint and test your code.
* 1.0.0 Initial release.
* 1.0.1 README added.
* 1.0.2 package.json improved.