From 6b5c52031bf03eef0af59475f6df401b22680575 Mon Sep 17 00:00:00 2001 From: Chris Burgess Date: Tue, 25 Apr 2017 22:51:41 +1200 Subject: [PATCH] CRM-13639 minor tidy up from larger pr on logging The PR is stalled but I wanted to pull out these comment changes for now --- CRM/Core/Error.php | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/CRM/Core/Error.php b/CRM/Core/Error.php index 1d2b465ca9..796382de93 100644 --- a/CRM/Core/Error.php +++ b/CRM/Core/Error.php @@ -528,29 +528,23 @@ class CRM_Core_Error extends PEAR_ErrorStack { * in the formatting of the output. * * @param string $variable_name + * Variable name. * @param mixed $variable + * Variable value. * @param bool $print - * Should we use print_r ? (else we use var_dump). + * Use print_r (if true) or var_dump (if false). * @param bool $log - * Should we log or return the output. - * @param string $comp - * Variable name. + * Log or return the output? + * @param string $prefix + * Prefix for output logfile. * * @return string - * the generated output - * - * + * The generated output * * @see CRM_Core_Error::debug() * @see CRM_Core_Error::debug_log_message() */ - public static function debug_var( - $variable_name, - $variable, - $print = TRUE, - $log = TRUE, - $comp = '' - ) { + public static function debug_var($variable_name, $variable, $print = TRUE, $log = TRUE, $prefix = '') { // check if variable is set if (!isset($variable)) { $out = "\$$variable_name is not set"; @@ -573,7 +567,7 @@ class CRM_Core_Error extends PEAR_ErrorStack { reset($variable); } } - return self::debug_log_message($out, FALSE, $comp); + return self::debug_log_message($out, FALSE, $prefix); } /** @@ -586,17 +580,17 @@ class CRM_Core_Error extends PEAR_ErrorStack { * @param bool $out * Should we log or return the output. * - * @param string $comp - * Message to be output. + * @param string $prefix + * Message prefix. * @param string $priority * * @return string * Format of the backtrace */ - public static function debug_log_message($message, $out = FALSE, $comp = '', $priority = NULL) { + public static function debug_log_message($message, $out = FALSE, $prefix = '', $priority = NULL) { $config = CRM_Core_Config::singleton(); - $file_log = self::createDebugLogger($comp); + $file_log = self::createDebugLogger($prefix); $file_log->log("$message\n", $priority); $str = '

' . htmlspecialchars($message) . ''; -- 2.25.1