mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Add logs
This commit is contained in:
1 parent
f482d96225
commit
c2bdbbe1ec
10 files changed
+80
-16
No files matched your search
@@ -5,14 +5,19 @@ use Appwrite\Utopia\Response;
|
||||
use Utopia\App;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Validator\Text;
|
||||
use Utopia\Logger\Log;
|
||||
|
||||
App::init()
|
||||
->groups(['console'])
|
||||
->inject('project')
|
||||
->action(function (Document $project) {
|
||||
->inject('startTime')
|
||||
->inject('log')
|
||||
->action(function (Document $project, float $startTime, Log $log) {
|
||||
$log->addExtra('consoleInitStart', \strval(\microtime(true)));
|
||||
if ($project->getId() !== 'console') {
|
||||
throw new Exception(Exception::GENERAL_ACCESS_FORBIDDEN);
|
||||
}
|
||||
$log->addExtra('consoleInitEnd', \strval(\microtime(true)));
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user