From a61b62e592380fa3be7e4ff812f3e514afabd321 Mon Sep 17 00:00:00 2001 From: nickw Date: Fri, 16 Oct 2009 22:53:22 +0000 Subject: Rewriting core debug messages to be more informative. Introducing the concept of levels for Elgg debugging: notices, warnings and errors are displayed when the appropriate debugging level is enabled. An additional level of "debug" exists to differentiate from errors. git-svn-id: http://code.elgg.org/elgg/trunk@3560 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/api.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'engine/lib/api.php') diff --git a/engine/lib/api.php b/engine/lib/api.php index 53af1af67..301922636 100644 --- a/engine/lib/api.php +++ b/engine/lib/api.php @@ -104,7 +104,7 @@ abstract class GenericResult { $result->result = $resultdata; } - if ((isset($CONFIG->debug)) && ($CONFIG->debug == true)) { + if (isset($CONFIG->debug)) { if (count($ERRORS)) { $result->runtime_errors = $ERRORS; } @@ -656,9 +656,7 @@ function map_api_hash($algo) { function calculate_hmac($algo, $time, $api_key, $secret_key, $get_variables, $post_hash = "") { global $CONFIG; - if ((isset($CONFIG)) && ($CONFIG->debug)) { - error_log("HMAC Parts: $algo, $time, $api_key, $secret_key, $get_variables, $post_hash"); - } + elgg_log("HMAC Parts: $algo, $time, $api_key, $secret_key, $get_variables, $post_hash"); $ctx = hash_init(map_api_hash($algo), HASH_HMAC, $secret_key); @@ -1115,9 +1113,7 @@ function send_api_call(array $keys, $url, array $call, $method = 'GET', $post_da $context = stream_context_create($opts); // Send the query and get the result and decode. - if ((isset($CONFIG->debug)) && ($CONFIG->debug)) { - error_log("APICALL: $url"); - } + elgg_log("APICALL: $url"); $APICLIENT_LAST_CALL_RAW = file_get_contents($url, false, $context); $APICLIENT_LAST_CALL = unserialize($APICLIENT_LAST_CALL_RAW); -- cgit v1.2.3