1.0.0 • Published 4 years ago

interfy v1.0.0

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

interfy

interfy allows you to easily use basic console logging capabilities, whilst also returning the log for you to use. this makes it super easy to create custom logging functionality, without having to worry about intercepting the output.

use

interfy does not replace the console based logging system, instead, it uses it. this means you can still use normal logging, or choose to get the logs returned too. each type keeps its name while using interfy, this means that console.log is just reference as interfy.log. this carries for each console ability.

here is an example of how interfy.log is used:

interfy.log("hello %s", "world") // > "hello world"
.then(console.log); // > ["hello %s", "world"]

this same trend continues with:

  • log
  • info
  • warn
  • error

there is one exception here which is the interfy.out function. this function takes in a function as the first argument, and the arguments for that function after it. it the returns the log in the same way as the others.

here is an example of how interfy.out is used:

interfy.out(console.log, "hello %s", "world") // > "hello world"
.then(console.log); // > ["hello %s", "world"]
1.0.0

4 years ago