. * * @package LibreNMS * @link http://librenms.org * @copyright 2018 Tony Murray * @author Tony Murray */ if (!function_exists('d_echo')) { /** * Legacy convenience function - please use this instead of 'if ($debug) { echo ...; }' * Use Log directly in pure Laravel code! * * @param string|array $text The error message or array to print * @param string $no_debug_text Text to print if debug is disabled */ function d_echo($text, $no_debug_text = null) { global $debug; if (class_exists('\Log')) { \Log::debug(is_string($text) ? rtrim($text) : $text); } elseif ($debug) { print_r($text); } if (!$debug && $no_debug_text) { echo "$no_debug_text"; } } }