Topic: Share: logging PHP in console for debugging

I just want to share a really simple way but helpful if you are developing application in FA (or PHP in general). You can log into browser console using this library: https://github.com/ccampbell/chromephp. Put the library file in includes/ folder.

Then, just add below code in session.inc.

include_once($path_to_root . "/includes/ChromePhp.php");
function ConsoleDebug($obj){
    ChromePhp::log($obj);
}

You can use it for debugging by just call ConsoleDebug($anything). It will appear in the browser console. In firefox, you don't need to install anything but in chrome you need to install extension.

For me, it is useful to debug ajax call which FA use quite a lot in many places.

Re: Share: logging PHP in console for debugging

@barbarian: Thanks for sharing.

Wiki-ed it.

ChromeLogger is available for quite a few programming languages.

The entire Troubleshooting FA wiki page as on date is attached for offline usage.

Post's attachments

Troubleshooting FrontAccounting_2017-11-04.pdf 106.5 kb, 17 downloads since 2017-11-04 

You don't have the permssions to download the attachments of this post.