Skip to content

Commit

Permalink
fix: log levels
Browse files Browse the repository at this point in the history
  • Loading branch information
hschoenenberger committed Oct 3, 2024
1 parent b0313cc commit fae53bb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/Hook/ActionObjectShopDeleteBefore.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ public function execute(array $params = [])
$response = $this->commandBus->handle(new DeleteUserShopCommand($params['object']->id));

if (!$response) {
$this->module->getLogger()->debug(
$this->module->getLogger()->error(
'Error trying to DELETE shop : No $response object'
);
} elseif (true !== $response['status']) {
$this->module->getLogger()->debug(
$this->module->getLogger()->error(
'Error trying to DELETE shop : ' . $response['httpCode'] .
' ' . print_r($response['body']['message'], true)
);
}
} catch (Exception $e) {
$this->module->getLogger()->debug(
$this->module->getLogger()->error(
'Error while trying to DELETE shop : ' . print_r($e->getMessage(), true)
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Hook/ActionObjectShopUpdateAfter.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ protected function updateUserShop(\Shop $shop)
])));

if (!$response) {
$this->module->getLogger()->debug('Error trying to PATCH shop : No $response object');
$this->module->getLogger()->error('Error trying to PATCH shop : No $response object');
} elseif (true !== $response['status']) {
$this->module->getLogger()->debug('Error trying to PATCH shop : ' . $response['httpCode'] .
$this->module->getLogger()->error('Error trying to PATCH shop : ' . $response['httpCode'] .
' ' . print_r(isset($response['body']['message']) ? $response['body']['message'] : '', true)
);
}
} catch (Exception $e) {
$this->module->getLogger()->debug('Error trying to PATCH shop: ' . $e->getMessage());
$this->module->getLogger()->error('Error trying to PATCH shop: ' . $e->getMessage());
}
}
}
6 changes: 3 additions & 3 deletions src/Http/Client/Guzzle/GuzzleClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ private function logResponseError(array $response, array $options)
$module = \Module::getInstanceByName('ps_accounts');
try {
$logger = $module->getLogger();
$logger->debug('route ' . $this->getRoute());
$logger->debug('options ' . var_export($options, true));
$logger->debug('response ' . var_export($response, true));
$logger->error('route ' . $this->getRoute());
$logger->error('options ' . var_export($options, true));
$logger->error('response ' . var_export($response, true));
} catch (\Exception $e) {
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Repository/ConfigurationRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ public function updateAccessToken($accessToken)
*/
public function fixMultiShopConfig()
{
Logger::getInstance()->error(__METHOD__);
Logger::getInstance()->info(__METHOD__);

if ($this->isMultishopActive()) {
$this->migrateToMultiShop();
Expand Down

0 comments on commit fae53bb

Please sign in to comment.