if (!empty(\Civi::$statics[__CLASS__]['userFrameworkLogging'])) {
// should call $config->userSystem->logger($message) here - but I got a situation where userSystem was not an object - not sure why
if ($config->userSystem->is_drupal and function_exists('watchdog')) {
- watchdog('civicrm', '%message', ['%message' => $message], isset($priority) ? $priority : WATCHDOG_DEBUG);
+ watchdog('civicrm', '%message', ['%message' => $message], $priority ?? WATCHDOG_DEBUG);
}
}
*
* @param string $prefix
*
- * @return Log
+ * @return Log_file
*/
public static function createDebugLogger($prefix = '') {
self::generateLogFileName($prefix);
$ret = [];
foreach ($backTrace as $trace) {
$args = [];
- $fnName = CRM_Utils_Array::value('function', $trace);
+ $fnName = $trace['function'] ?? NULL;
$className = isset($trace['class']) ? ($trace['class'] . $trace['type']) : '';
// Do not show args for a few password related functions
- $skipArgs = ($className == 'DB::' && $fnName == 'connect') ? TRUE : FALSE;
+ $skipArgs = $className == 'DB::' && $fnName == 'connect';
if (!empty($trace['args'])) {
foreach ($trace['args'] as $arg) {
*/
public static function deprecatedFunctionWarning($newMethod) {
$dbt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
- $callerFunction = isset($dbt[1]['function']) ? $dbt[1]['function'] : NULL;
- $callerClass = isset($dbt[1]['class']) ? $dbt[1]['class'] : NULL;
+ $callerFunction = $dbt[1]['function'] ?? NULL;
+ $callerClass = $dbt[1]['class'] ?? NULL;
Civi::log()->warning("Deprecated function $callerClass::$callerFunction, use $newMethod.", ['civi.tag' => 'deprecated']);
}