Skip to content

Commit

Permalink
Remove hard log /tmp/debug.log, close #74
Browse files Browse the repository at this point in the history
  • Loading branch information
vpietri committed Apr 2, 2024
1 parent 0c37baf commit 566b4fd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
11 changes: 0 additions & 11 deletions Helper/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ public function __construct(Context $context,
$this->objectFactory = $objectFactory;
$this->qdbHelper = $qdbHelper;
$this->services = $services;
file_put_contents('/tmp/debug.log', __METHOD__.__LINE__.PHP_EOL, FILE_APPEND);

if($this->qdbHelper->isToolbarAccessAllowed() && $this->qdbHelper->isAjaxLoading()) {
file_put_contents('/tmp/debug.log', __METHOD__.__LINE__.PHP_EOL, FILE_APPEND);

register_shutdown_function([$this, 'dumpToFile']);
}
}
Expand All @@ -51,21 +47,14 @@ public function __construct(Context $context,
*/
public function dumpToFile()
{

file_put_contents('/tmp/debug.log', __METHOD__.__LINE__.PHP_EOL, FILE_APPEND);

if($this->_getRequest() && $this->_getRequest()->getModuleName()=='quickdevbar') {
file_put_contents('/tmp/debug.log', __METHOD__.__LINE__.PHP_EOL, FILE_APPEND);
return false;
}
file_put_contents('/tmp/debug.log', __METHOD__.__LINE__.PHP_EOL, FILE_APPEND);

foreach ($this->services as $serviceKey => $serviceObj) {
$this->setRegisteredData($serviceKey, $serviceObj->pullData());
}
file_put_contents('/tmp/debug.log', __METHOD__.__LINE__.PHP_EOL, FILE_APPEND);
$content = $this->registeredData->convertToJson();
file_put_contents('/tmp/debug.log', __METHOD__.__LINE__.PHP_EOL, FILE_APPEND);
$this->qdbHelper->setWrapperContent($content);
}

Expand Down
2 changes: 1 addition & 1 deletion Plugin/Framework/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ public function __construct(


public function afterSendResponse(\Magento\Framework\HTTP\PhpEnvironment\Response $subject) {
//file_put_contents('/tmp/test.log', print_r($this->_qdbHelperRegister->getEvents(), true), FILE_APPEND );

}
}

0 comments on commit 566b4fd

Please sign in to comment.