Remove logging in the class as the parent class now handles it (#7561)

* Remove logging in the class as the parent class now handles it

* Remove logging in the class as the parent class now handles it
This commit is contained in:
frytimo
2025-10-09 19:45:58 -03:00
committed by GitHub
parent 4959f6a1e7
commit 1b7d320f93
2 changed files with 10 additions and 42 deletions

View File

@@ -418,22 +418,6 @@ class active_calls_service extends service implements websocket_service_interfac
return 0;
}
private function debug(string $message) {
self::log($message, LOG_DEBUG);
}
private function warn(string $message) {
self::log($message, LOG_WARNING);
}
private function error(string $message) {
self::log($message, LOG_ERR);
}
private function info(string $message) {
self::log($message, LOG_INFO);
}
private function on_authenticate(websocket_message $websocket_message) {
$this->info("Authenticating with websocket server");
// Create a service token
@@ -446,7 +430,7 @@ class active_calls_service extends service implements websocket_service_interfac
private function on_in_progress(websocket_message $websocket_message) {
// Check permission
if (!$websocket_message->has_permission('call_active_view')) {
$this->warn("Permission 'call_active_show' not found in subscriber request");
$this->warning("Permission 'call_active_show' not found in subscriber request");
websocket_client::send($this->ws_client->socket(), websocket_message::request_forbidden($websocket_message->request_id, SERVICE_NAME, $websocket_message->topic));
}
@@ -481,7 +465,7 @@ class active_calls_service extends service implements websocket_service_interfac
private function on_hangup(websocket_message $websocket_message) {
// Check permission
if (!$websocket_message->has_permission('call_active_hangup')) {
$this->warn("Permission 'call_active_hangup' not found in subscriber request");
$this->warning("Permission 'call_active_hangup' not found in subscriber request");
websocket_client::send($this->ws_client->socket(), websocket_message::request_forbidden($websocket_message->request_id, SERVICE_NAME, $websocket_message->topic));
}
@@ -513,7 +497,7 @@ class active_calls_service extends service implements websocket_service_interfac
// Make sure we are connected
if (!$event_socket->is_connected()) {
$this->warn("Unable to connect to event socket");
$this->warning("Unable to connect to event socket");
return;
}
@@ -542,13 +526,13 @@ class active_calls_service extends service implements websocket_service_interfac
private function on_eavesdrop(websocket_message $websocket_message) {
// Check permission
if (!$websocket_message->has_permission('call_active_eavesdrop')) {
$this->warn("Permission 'call_active_eavesdrop' not found in subscriber request");
$this->warning("Permission 'call_active_eavesdrop' not found in subscriber request");
websocket_client::send($this->ws_client->socket(), websocket_message::request_forbidden($websocket_message->request_id, SERVICE_NAME, $websocket_message->topic));
}
// Make sure we are connected
if (!$this->event_socket->is_connected()) {
$this->warn("Failed to hangup call because event socket no longer connected");
$this->warning("Failed to hangup call because event socket no longer connected");
return;
}
@@ -641,7 +625,7 @@ class active_calls_service extends service implements websocket_service_interfac
//set up the socket away from the event_socket object so we have control over blocking
$this->switch_socket = stream_socket_client("tcp://$host:$port", $errno, $errstr, 5);
} catch (\RuntimeException $re) {
$this->warn('Unable to connect to event socket');
$this->warning('Unable to connect to event socket');
}
// If we didn't connect then return back false
@@ -813,7 +797,7 @@ class active_calls_service extends service implements websocket_service_interfac
// Nothing to do
if ($json_string === null) {
$this->warn('Message received from Websocket is empty');
$this->warning('Message received from Websocket is empty');
return;
}

View File

@@ -562,7 +562,7 @@ class websocket_service extends service {
$this->disconnect_client($client_socket);
continue;
}
$this->err("UNKNOWN CONTROL FRAME: '$value'");
$this->error("UNKNOWN CONTROL FRAME: '$value'");
}
try {
@@ -585,8 +585,8 @@ class websocket_service extends service {
//
// Dump the details in the log
//
$this->err("ERROR FROM $subscriber_id: $message ($code) IN FILE $file (Line: $line)");
$this->err($se->getTraceAsString());
$this->error("ERROR FROM $subscriber_id: $message ($code) IN FILE $file (Line: $line)");
$this->error($se->getTraceAsString());
//
// Disconnect the subscriber
//
@@ -860,22 +860,6 @@ class websocket_service extends service {
return $data;
}
private function debug(string $message) {
self::log($message, LOG_DEBUG);
}
private function warning(string $message) {
self::log($message, LOG_WARNING);
}
private function err(string $message) {
self::log($message, LOG_ERR);
}
private function info(string $message) {
self::log($message, LOG_INFO);
}
/**
* Send text frame to client. If the socket connection is not a valid resource, the send
* method will fail silently and return false.