Updated to new utopia logger, removed leftover

This commit is contained in:
Matej Baco
2021-11-29 13:52:18 +01:00
parent a8bf2a4f59
commit 7bed9aed5b
2 changed files with 11 additions and 12 deletions
+5 -6
View File
@@ -81,7 +81,7 @@ $logError = function(Throwable $error, string $action) use ($register) {
Console::info('Realtime log pushed with status code: '.$responseCode);
};
$server->onError($logError);
$server->error($logError);
$server->onStart(function () use ($stats, $register, $containerId, &$documentId, $logError) {
Console::success('Server started succefully');
@@ -125,8 +125,7 @@ $server->onStart(function () use ($stats, $register, $containerId, &$documentId,
Authorization::enable();
$documentId = $document->getId();
} catch (\Throwable $th) {
var_dump("Error starting");
call_user_func($logError, $th, "onStart.createDocument");
call_user_func($logError, $th, "createWorkerDocument");
Console::error('[Error] Type: ' . get_class($th));
Console::error('[Error] Message: ' . $th->getMessage());
@@ -191,7 +190,7 @@ $server->onStart(function () use ($stats, $register, $containerId, &$documentId,
'value' => json_encode($payload)
]);
} catch (\Throwable $th) {
logError($register, $th, "onStart.updateDocument");
logError($register, $th, "updateWorkerDocument");
Console::error('[Error] Type: ' . get_class($th));
Console::error('[Error] Message: ' . $th->getMessage());
@@ -366,7 +365,7 @@ $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats,
}
});
} catch (\Throwable $th) {
logError($register, $th, "onWorkerStart.pubSubConnection");
logError($register, $th, "pubSubConnection");
Console::error('Pub/sub error: ' . $th->getMessage());
$register->get('redisPool')->put($redis);
@@ -484,7 +483,7 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server,
$stats->incr($project->getId(), 'connections');
$stats->incr($project->getId(), 'connectionsTotal');
} catch (\Throwable $th) {
logError($register, $th, "onOpen.init");
logError($register, $th, "initServer");
$response = [
'type' => 'error',
Generated
+6 -6
View File
@@ -2066,7 +2066,7 @@
"source": {
"type": "git",
"url": "https://github.com/utopia-php/logger",
"reference": "5d8cc1bbbfc738ae28ede0d438a1d5318011cf6a"
"reference": "572ada8fd774cb8c6c09aab9fe2d36cd807eee13"
},
"require": {
"php": ">=7.4"
@@ -2113,7 +2113,7 @@
"utopia",
"warnings"
],
"time": "2021-11-24T09:10:10+00:00"
"time": "2021-11-29T08:40:52+00:00"
},
{
"name": "utopia-php/orchestration",
@@ -2444,12 +2444,12 @@
"source": {
"type": "git",
"url": "https://github.com/utopia-php/websocket.git",
"reference": "917f82f617bda5a0b63b4c94f32cada43acc7fb0"
"reference": "237eed7e9c54a514cfabac3e5726d24661254f2e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/websocket/zipball/917f82f617bda5a0b63b4c94f32cada43acc7fb0",
"reference": "917f82f617bda5a0b63b4c94f32cada43acc7fb0",
"url": "https://api.github.com/repos/utopia-php/websocket/zipball/237eed7e9c54a514cfabac3e5726d24661254f2e",
"reference": "237eed7e9c54a514cfabac3e5726d24661254f2e",
"shasum": ""
},
"require": {
@@ -2494,7 +2494,7 @@
"issues": "https://github.com/utopia-php/websocket/issues",
"source": "https://github.com/utopia-php/websocket/tree/feat-onerror-callback"
},
"time": "2021-11-24T12:04:35+00:00"
"time": "2021-11-29T08:43:24+00:00"
},
{
"name": "webmozart/assert",