I recently came across this great plugin for Chrome called Chrome Logger.
Basically, it allows you to target the developer console in Chrome from within PHP. It’s really handy for debugging live PHP sites without printing nasty var_dump()’s to the screen, or SSH’ing into a server and watching logs.
It’s really simple to use too.
In my case for PHP get the script to integrate with the plugin:
Then in your code, just include the chromephp plugin:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|include ABSPATH . 'ChromeLogger.php';|
|ChromePhp::warn('something went wrong!');|
That’s it, then you get pretty debugging information in your console: