Skip to content

Instantly share code, notes, and snippets.

@ynaoto
Last active December 14, 2015 22:29
Show Gist options
  • Save ynaoto/5159138 to your computer and use it in GitHub Desktop.
Save ynaoto/5159138 to your computer and use it in GitHub Desktop.
An error logger function for debug purpose.
function log($msg)
{
$args = func_get_args();
array_shift($args); // $msg
error_log(array_reduce($args, function($v, $w) {
return $v . var_export($w, true);
}, $msg));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment