@matthewbonig/simple-logger
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Simple Logger

This is a super simple logger. It is implemented as a Higher Order Function. Give it a function and it will return a new function that logs the original functions inputs and outputs.

For example:

function add(one: number, two: number){
  return one + two;
}

useLogger(add)(1, 2)

/*
 will log:
 
Array [
  "Executing add with args: {
  \\"0\\": 1,
  \\"1\\": 2
}",
]

Array [
  "Function add returned: {
  \\"result\\": 3
}",
]

 */

Readme

Keywords

Package Sidebar

Install

npm i @matthewbonig/simple-logger

Weekly Downloads

0

Version

0.0.2

License

Apache-2.0

Unpacked Size

25.5 kB

Total Files

10

Last publish

Collaborators

  • matthewbonig