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/memcache.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'engine/lib/memcache.php') diff --git a/engine/lib/memcache.php b/engine/lib/memcache.php index 498d1ff4f..ed93cacf0 100644 --- a/engine/lib/memcache.php +++ b/engine/lib/memcache.php @@ -77,9 +77,7 @@ class ElggMemcache extends ElggSharedMemoryCache { } } } else { - if ((isset($CONFIG->debug)) && ($CONFIG->debug == true)) { - error_log(elgg_echo('memcache:noaddserver')); - } + elgg_log(elgg_echo('memcache:noaddserver'), 'ERROR'); $server = $CONFIG->memcache_servers[0]; if (is_array($server)) { @@ -131,8 +129,8 @@ class ElggMemcache extends ElggSharedMemoryCache { $key = $this->make_memcache_key($key); $result = $this->memcache->set($key, $data, null, $this->expires); - if ((isset($CONFIG->debug)) && ($CONFIG->debug == true) && (!$result)) { - error_log("MEMCACHE: FAILED TO SAVE $key"); + if (!$result) { + elgg_log("MEMCACHE: FAILED TO SAVE $key", 'ERROR'); } return $result; @@ -142,8 +140,8 @@ class ElggMemcache extends ElggSharedMemoryCache { $key = $this->make_memcache_key($key); $result = $this->memcache->get($key); - if ((isset($CONFIG->debug)) && ($CONFIG->debug == true) && (!$result)) { - error_log("MEMCACHE: FAILED TO LOAD $key"); + if (!$result) { + elgg_log("MEMCACHE: FAILED TO LOAD $key", 'ERROR'); } return $result; -- cgit v1.2.3