1.0.1 • Published 4 years ago

@alu0101016733/add-logging v1.0.1

Weekly downloads
-
License
-
Repository
github
Last release
4 years ago

add-logging

Author: alu0101016733

Email: alu0101016733@ull.edu.es

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 --save

Global installation

user@user:~$ npm install -g @alu0101016733/add-logging

Using the executable:

When installed Locally we would run it with

npm exec path_to_bin

Else 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 command

Usage:

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