Skip to content

Instantly share code, notes, and snippets.


tommcfarlin/00-log.php Secret

Created Sep 3, 2018
What would you like to do?
[WordPress] Writing Messages to the WordPress Debug Log
* 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) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment