HSChromeLogger! tries to queue all Chrome Logger logging statements and to rebuild them after page redirection which is used by Joomla! to execute tasks.
However some information cannot be queued and thus not rebuild after page redirection either.
Use the object oriented API when you want to keep the logging statements in your application. It will provide more flexibility and future-proof your code.
CL:: *
Logging is enabled by default. You can disable it with setEnabled(false)
.
Use this method to disable logging on your live site for everyone except authorized users. The authorization is also handled by the HSChromeLogger! plugin.
CL::setEnabled(false);
Error, exception and assertion handling can be (de)activated on the advanced tab of the HSChromeLogger! plugin.
Convert E_WARNING
, E_NOTICE
, E_USER_ERROR
, E_USER_WARNING
, E_USER_NOTICE
, E_STRICT
, E_RECOVERABLE_ERROR
, E_DEPRECATED
and E_USER_DEPRECATED
errors to ErrorExceptions
and send all exceptions to the web console automatically if desired.
Assertion errors can be converted to exceptions and thrown if desired.
You can also manually send caught exceptions to the web console.
try { throw new Exception('Test Exception'); } catch (Exception $e) { CL::error($e); }
In many cases it is useful to group logging messages together. Groups can be nested programmatically.
CL::group('Test Group'); CL::log('Hello World'); CL::groupEnd();
These logging methods follow the four web console logging priorities.
CL::log('Plain Message'); CL::info('Info Message'); CL::warn('Warn Message'); CL::error('Error Message');
You can log tables of information. The web console will allow the user to toggle the display of the table.
$table = array(); $table[] = array('Row 0 Col 0','Row 0 Col 1'); $table[] = array('Row 1 Col 0','Row 1 Col 1'); $table[] = array('Row 2 Col 0','Row 2 Col 1'); CL::table($table);