Skip to content

Instantly share code, notes, and snippets.

@bUxEE
Last active September 2, 2018 09:37
Show Gist options
  • Save bUxEE/2ce5454cf681a132133432386376cadd to your computer and use it in GitHub Desktop.
Save bUxEE/2ce5454cf681a132133432386376cadd to your computer and use it in GitHub Desktop.
error_log
function elogp($var, $level="", $log="") {
$date = date("d-m-Y h:m:s");
$t = debug_backtrace();
$file = $t[0]['file'];
$level = $level == "" ? "info" : $level;
$log = $log == "" ? ABSPATH."/elogp.log" : $log;
$message = "[{$date}] [{$file}] [{$level}] ".print_r($var, true).PHP_EOL;
error_log($message, 3, $log);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment