-
-
Save tommcfarlin/d8bed85851dad283183d84a819dd6c9a to your computer and use it in GitHub Desktop.
[WordPress] Writing Messages to the WordPress Debug Log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Prints a message to the debug file that can easily be called by any subclass. | |
* | |
* @param mixed $message an object, array, string, number, or other data to write to the debug log | |
* @param bool $shouldNotDie whether or not the The function should exit after writing to the log | |
* | |
*/ | |
protected function log($message, $shouldNotDie = true) | |
{ | |
error_log(print_r($message, true)); | |
if ($shouldNotDie) { | |
exit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment