0.0.2 • Published 2 years ago

@matthewbonig/simple-logger v0.0.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

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
}",
]

 */