Skip to content

Commit f634608

Browse files
committed
adding logging
1 parent da0e418 commit f634608

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/app/code/community/Zendesk/Zendesk/Helper/Data.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -229,17 +229,9 @@ public function getOrderDetail($order)
229229

230230
public function getSupportEmail($store = null)
231231
{
232-
// Serves as the dafault email
233232
$domain = Mage::getStoreConfig('zendesk/general/domain', $store);
234233
$email = 'support@' . $domain;
235234

236-
// Get the actual default email from the API, return the default if somehow none is found
237-
$defaultRecipient = Mage::getModel('zendesk/api_supportAddresses')->getDefault();
238-
239-
if (!is_null($defaultRecipient)) {
240-
$email = $defaultRecipient['email'];
241-
}
242-
243235
return $email;
244236
}
245237

@@ -364,7 +356,7 @@ public function getFormatedDateTime($dateToFormat) {
364356
public function getConnectionStatus() {
365357
try {
366358
$user = Mage::getModel('zendesk/api_users')->me();
367-
359+
368360
if($user['id']) {
369361
return array(
370362
'success' => true,

src/app/code/community/Zendesk/Zendesk/Model/Api/Abstract.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,17 @@ protected function _call($endpoint, $params = null, $method = 'GET', $data = nul
7171

7272
try {
7373
$response = $client->request();
74-
} catch ( Exception $ex ) {
74+
} catch ( Zend_Http_Client_Exception $ex ) {
75+
Mage::log('Call to ' . $url . ' resulted in: ' . $ex->getMessage(), Zend_Log::ERR, 'zendesk.log');
76+
Mage::log('--Last Request: ' . $client->getLastRequest(), Zend_Log::ERR, 'zendesk.log');
77+
Mage::log('--Last Response: ' . $client->getLastResponse(), Zend_Log::ERR, 'zendesk.log');
78+
7579
return array();
7680
}
7781

7882
$body = json_decode($response->getBody(), true);
7983

80-
Mage::log(var_export($body, true), null, 'zendesk.log');
84+
Mage::log(var_export($body, true), Zend_Log::DEBUG, 'zendesk.log');
8185

8286
if($response->isError()) {
8387
if(is_array($body) && isset($body['error'])) {

0 commit comments

Comments
 (0)