Update and rename current method name.txt to log-method-name.md

This commit is contained in:
Angelos Chalaris
2017-12-16 14:37:45 +02:00
committed by GitHub
parent 90ffdb4b89
commit 07bf1cad8c
2 changed files with 8 additions and 3 deletions

View File

@ -1,3 +0,0 @@
###code to view name of current method
String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();

View File

@ -0,0 +1,8 @@
### Log method name
Use `console.debug()` and the `name` property of the passed method to log the method's name to the `debug` channel of the console.
```js
const methodName = fn => (console.debug(fn.name), fn);
// methodName(methodName) -> methodName (logged in debug channel of console)
```