From 733181a215129bb4c29ebc9851bd12278c4a0a2f Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Wed, 10 Nov 2021 16:51:11 +0000 Subject: [PATCH] Switch to debug level logging for lock debugging --- CRM/Core/Lock.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CRM/Core/Lock.php b/CRM/Core/Lock.php index 894b913ab2..5f3362dc00 100644 --- a/CRM/Core/Lock.php +++ b/CRM/Core/Lock.php @@ -124,7 +124,7 @@ class CRM_Core_Lock implements \Civi\Core\Lock\LockInterface { // MySQL 5.7 doesn't like long lock names so creating a lock id $this->_id = sha1($this->_name); if (defined('CIVICRM_LOCK_DEBUG')) { - CRM_Core_Error::debug_log_message('trying to construct lock for ' . $this->_name . '(' . $this->_id . ')'); + \Civi::log()->debug('trying to construct lock for ' . $this->_name . '(' . $this->_id . ')'); } $this->_timeout = $timeout !== NULL ? $timeout : self::TIMEOUT; } @@ -177,7 +177,7 @@ class CRM_Core_Lock implements \Civi\Core\Lock\LockInterface { $res = CRM_Core_DAO::singleValueQuery($query, $params); if ($res) { if (defined('CIVICRM_LOCK_DEBUG')) { - CRM_Core_Error::debug_log_message('acquire lock for ' . $this->_name . '(' . $this->_id . ')'); + \Civi::log()->debug('acquire lock for ' . $this->_name . '(' . $this->_id . ')'); } $this->_hasLock = TRUE; if (stristr($this->_name, 'data.mailing.job.')) { @@ -186,7 +186,7 @@ class CRM_Core_Lock implements \Civi\Core\Lock\LockInterface { } else { if (defined('CIVICRM_LOCK_DEBUG')) { - CRM_Core_Error::debug_log_message('failed to acquire lock for ' . $this->_name . '(' . $this->_id . ')'); + \Civi::log()->debug('failed to acquire lock for ' . $this->_name . '(' . $this->_id . ')'); } } } @@ -199,7 +199,7 @@ class CRM_Core_Lock implements \Civi\Core\Lock\LockInterface { public function release() { if ($this->_hasLock) { if (defined('CIVICRM_LOCK_DEBUG')) { - CRM_Core_Error::debug_log_message('release lock for ' . $this->_name . '(' . $this->_id . ')'); + \Civi::log()->debug('release lock for ' . $this->_name . '(' . $this->_id . ')'); } $this->_hasLock = FALSE; @@ -244,11 +244,11 @@ class CRM_Core_Lock implements \Civi\Core\Lock\LockInterface { */ public function hackyHandleBrokenCode($jobLog) { if (stristr($this->_name, 'job')) { - CRM_Core_Error::debug_log_message('lock acquisition for ' . $this->_name . '(' . $this->_id . ')' . ' attempted when ' . $jobLog . ' is not released'); + \Civi::log()->debug('lock acquisition for ' . $this->_name . '(' . $this->_id . ')' . ' attempted when ' . $jobLog . ' is not released'); throw new CRM_Core_Exception('lock acquisition for ' . $this->_name . '(' . $this->_id . ')' . ' attempted when ' . $jobLog . ' is not released'); } if (defined('CIVICRM_LOCK_DEBUG')) { - CRM_Core_Error::debug_log_message('(CRM-12856) faking lock for ' . $this->_name . '(' . $this->_id . ')'); + \Civi::log()->debug('(CRM-12856) faking lock for ' . $this->_name . '(' . $this->_id . ')'); } $this->_hasLock = TRUE; return TRUE; -- 2.25.1