Magento 2.x – Add log within one single line of code


If you are trying to debug in a remote server, or just want to temporary add a debug message. Then the following snippet would help you, adding your log to the debug.log file

Enjoy!