ChromeLogger for PHP

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:

include ABSPATH . 'ChromeLogger.php';
ChromePhp::log('Hello console!');
ChromePhp::warn('something went wrong!');

view raw


hosted with ❤ by GitHub

That’s it, then you get pretty debugging information in your console:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s