Skip to content

Instantly share code, notes, and snippets.

@m4rcsch
Created October 19, 2011 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m4rcsch/1297788 to your computer and use it in GitHub Desktop.
Save m4rcsch/1297788 to your computer and use it in GitHub Desktop.
Lithium (li3) Logger Helper for lazy coders..
/**
* Inspect the message, and do a string conversion via print_r
*
* @author: 2011 weluse GmbH, Marc Schwering
*/
Logger::applyFilter('write', function ($self, $params, $chain){
$var = $params['message'];
if(is_array($var) || is_object($var)){
$params['message'] = print_r($var,true);
}
return $chain->next($self, $params, $chain);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment