<?php

if (!function_exists('debug_log')) {
    /**
     * Write the debug log to the error log file.
     * @param mixed $message Debug log.
     * @return bool
     */
    function debug_log($message) {
        if (true === WP_DEBUG) {
            if (is_scalar($message)) {
                return error_log($message);
            } else {
                return error_log(print_r($message, true));
            }
        }
    }
}