diff options
author | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-10-16 22:53:22 +0000 |
---|---|---|
committer | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-10-16 22:53:22 +0000 |
commit | a61b62e592380fa3be7e4ff812f3e514afabd321 (patch) | |
tree | 225b02b83766778bfbadb0db37b715a79d9c05b2 /engine/lib/api.php | |
parent | 694781d190fba09437a37983f077d0381a56050b (diff) | |
download | elgg-a61b62e592380fa3be7e4ff812f3e514afabd321.tar.gz elgg-a61b62e592380fa3be7e4ff812f3e514afabd321.tar.bz2 |
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
Diffstat (limited to 'engine/lib/api.php')
-rw-r--r-- | engine/lib/api.php | 10 |
1 files changed, 3 insertions, 7 deletions
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); |