Merge pull request #8065 from appwrite/remove-logger-from-avatars
Remove logger code from avatars.php
This commit is contained in:
commit
2884ad0ca6
1 changed files with 0 additions and 35 deletions
|
@ -6,7 +6,6 @@ use Appwrite\Utopia\Response;
|
||||||
use chillerlan\QRCode\QRCode;
|
use chillerlan\QRCode\QRCode;
|
||||||
use chillerlan\QRCode\QROptions;
|
use chillerlan\QRCode\QROptions;
|
||||||
use Utopia\App;
|
use Utopia\App;
|
||||||
use Utopia\CLI\Console;
|
|
||||||
use Utopia\Config\Config;
|
use Utopia\Config\Config;
|
||||||
use Utopia\Database\Database;
|
use Utopia\Database\Database;
|
||||||
use Utopia\Database\DateTime;
|
use Utopia\Database\DateTime;
|
||||||
|
@ -16,9 +15,7 @@ use Utopia\Database\Validator\UID;
|
||||||
use Utopia\Domains\Domain;
|
use Utopia\Domains\Domain;
|
||||||
use Utopia\Fetch\Client;
|
use Utopia\Fetch\Client;
|
||||||
use Utopia\Image\Image;
|
use Utopia\Image\Image;
|
||||||
use Utopia\Logger\Log;
|
|
||||||
use Utopia\Logger\Logger;
|
use Utopia\Logger\Logger;
|
||||||
use Utopia\System\System;
|
|
||||||
use Utopia\Validator\Boolean;
|
use Utopia\Validator\Boolean;
|
||||||
use Utopia\Validator\HexColor;
|
use Utopia\Validator\HexColor;
|
||||||
use Utopia\Validator\Range;
|
use Utopia\Validator\Range;
|
||||||
|
@ -156,40 +153,8 @@ $getUserGitHub = function (string $userId, Document $project, Database $dbForPro
|
||||||
'id' => $githubId
|
'id' => $githubId
|
||||||
];
|
];
|
||||||
} catch (Exception $error) {
|
} catch (Exception $error) {
|
||||||
if ($logger) {
|
|
||||||
$version = System::getEnv('_APP_VERSION', 'UNKNOWN');
|
|
||||||
|
|
||||||
$log = new Log();
|
|
||||||
$log->setNamespace('console');
|
|
||||||
$log->setServer(\gethostname());
|
|
||||||
$log->setVersion($version);
|
|
||||||
$log->setType(Log::TYPE_ERROR);
|
|
||||||
$log->setMessage($error->getMessage());
|
|
||||||
|
|
||||||
$log->addTag('code', $error->getCode());
|
|
||||||
$log->addTag('verboseType', get_class($error));
|
|
||||||
|
|
||||||
$log->addExtra('file', $error->getFile());
|
|
||||||
$log->addExtra('line', $error->getLine());
|
|
||||||
$log->addExtra('trace', $error->getTraceAsString());
|
|
||||||
$log->addExtra('detailedTrace', $error->getTrace());
|
|
||||||
|
|
||||||
$log->setAction('avatarsGetGitHub');
|
|
||||||
|
|
||||||
$isProduction = System::getEnv('_APP_ENV', 'development') === 'production';
|
|
||||||
$log->setEnvironment($isProduction ? Log::ENVIRONMENT_PRODUCTION : Log::ENVIRONMENT_STAGING);
|
|
||||||
|
|
||||||
$responseCode = $logger->addLog($log);
|
|
||||||
Console::info('GitHub error log pushed with status code: ' . $responseCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
Console::warning("Failed: {$error->getMessage()}");
|
|
||||||
Console::warning($error->getTraceAsString());
|
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return [];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
App::get('/v1/avatars/credit-cards/:code')
|
App::get('/v1/avatars/credit-cards/:code')
|
||||||
|
|
Loading…
Reference in a new issue