@alu0101016733/add-logging
v1.0.1
Published
Adds logging code to javascript code functions
Downloads
46
Readme
add-logging
Author: alu0101016733
Email: [email protected]
add-logging is a mudule to add logs to javascript code at the beginning of each function to better see what is happening in execution time.
Installation
Local installation
user@user:~$ npm install @alu0101016733/add-logging --saveGlobal installation
user@user:~$ npm install -g @alu0101016733/add-loggingUsing the executable:
When installed Locally we would run it with
npm exec path_to_binElse we run it with add-logging.
Expects .js files to add logs to.
Usage: add-logging [options] <filename> [...]
Options:
-V, --version output the version number
-p, --pattern <pattern> to match function pattern
-o, --output <filename> Output filepath
-h, --help display help for commandUsage:
In the code implementation the addLogging module expects the program in string form.
const addLogging = require('@alu0101016733/add-logging');
//call function with string
//example call:
addLogging('function function1(data){}');
// Expected Output:
// function fan1(data) {
// console.log(`Entering fan1(${ data }) at line 2`);
// }Release History
- 0.1.0 alpha release
- 0.1.1 Minor changes in beta version
- 0.2.0 Added pattern option
- 1.0.0 First Beta release
