Skip to content

Instantly share code, notes, and snippets.

@khepin
Last active August 29, 2015 14:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khepin/0f8a822f7d987aedb7b2 to your computer and use it in GitHub Desktop.
Save khepin/0f8a822f7d987aedb7b2 to your computer and use it in GitHub Desktop.
if (!function_exists('debuglog')) {
function debuglog($message) {
if (!is_string($message)) {
$message = print_r($message, true);
}
$message .= "\n";
$dir = ROOT . '/../logs/';
if (!is_dir($dir)) {
mkdir($dir);
}
file_put_contents($dir . '/debug.log', $message, FILE_APPEND);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment