Skip to content

Commit aa80ffe

Browse files
authored
Merge pull request #69 from utopia-php/remove-console-logs
2 parents 2d693ec + 0984fce commit aa80ffe

File tree

3 files changed

+0
-70
lines changed

3 files changed

+0
-70
lines changed

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"require": {
2727
"php": ">=8.3",
2828
"php-amqplib/php-amqplib": "^3.7",
29-
"utopia-php/console": "0.0.*",
3029
"utopia-php/servers": "0.2.*",
3130
"utopia-php/fetch": "0.5.*",
3231
"utopia-php/pools": "1.*",

composer.lock

Lines changed: 0 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Queue/Server.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Exception;
66
use Throwable;
7-
use Utopia\Console;
87
use Utopia\Servers\Hook;
98
use Utopia\Telemetry\Adapter as Telemetry;
109
use Utopia\Telemetry\Adapter\None as NoTelemetry;
@@ -267,7 +266,6 @@ public function start(): self
267266
{
268267
try {
269268
$this->adapter->workerStart(function (string $workerId) {
270-
Console::success("[Worker] Worker {$workerId} started.");
271269
self::setResource('workerId', fn () => $workerId);
272270

273271
foreach ($this->workerStartHooks as $hook) {
@@ -278,9 +276,6 @@ public function start(): self
278276
$this->adapter->queue,
279277
function (Message $message) {
280278
$receivedAtTimestamp = microtime(true);
281-
Console::info(
282-
"[Job] Received Job ({$message->getPid()}).",
283-
);
284279
try {
285280
$waitDuration =
286281
microtime(true) - $message->getTimestamp();
@@ -353,18 +348,8 @@ function (Message $message) {
353348
}
354349
}
355350
}
356-
Console::success(
357-
"[Job] ({$message->getPid()}) successfully run.",
358-
);
359351
},
360352
function (?Message $message, Throwable $th) {
361-
Console::error(
362-
"[Job] ({$message?->getPid()}) failed to run.",
363-
);
364-
Console::error(
365-
"[Job] ({$message?->getPid()}) {$th->getMessage()}",
366-
);
367-
368353
self::setResource('error', fn () => $th);
369354

370355
foreach ($this->errorHooks as $hook) {
@@ -383,17 +368,11 @@ function (?Message $message, Throwable $th) {
383368
try {
384369
$hook->getAction()(...$this->getArguments($hook));
385370
} catch (Throwable $e) {
386-
Console::error(
387-
"[Worker] Worker {$workerId} workerStop hook failed: {$e->getMessage()}",
388-
);
389371
}
390372
}
391373
} finally {
392374
// Always close consumer connection, even if hooks throw
393375
$this->adapter->consumer->close();
394-
Console::success(
395-
"[Worker] Worker {$workerId} stopped.",
396-
);
397376
}
398377
});
399378

0 commit comments

Comments
 (0)