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/metastrings.php | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'engine/lib/metastrings.php') diff --git a/engine/lib/metastrings.php b/engine/lib/metastrings.php index 519d186e4..3e8796d3f 100644 --- a/engine/lib/metastrings.php +++ b/engine/lib/metastrings.php @@ -28,10 +28,7 @@ function get_metastring_id($string, $case_sensitive = true) { $string = sanitise_string($string); $result = array_search($string, $METASTRINGS_CACHE); if ($result!==false) { - if (isset($CONFIG->debug) && $CONFIG->debug) { - error_log("** Returning id for string:$string from cache."); - } - + elgg_log("** Returning id for string:$string from cache."); return $result; } @@ -68,9 +65,7 @@ function get_metastring_id($string, $case_sensitive = true) { $metastrings_memcache->save($row->string, $row->id); } - if (isset($CONFIG->debug) && $CONFIG->debug) { - error_log("** Cacheing string '{$row->string}'"); - } + elgg_log("** Cacheing string '{$row->string}'"); return $row->id; } else { @@ -92,9 +87,7 @@ function get_metastring($id) { $id = (int) $id; if (isset($METASTRINGS_CACHE[$id])) { - if ($CONFIG->debug) { - error_log("** Returning string for id:$id from cache."); - } + elgg_log("** Returning string for id:$id from cache."); return $METASTRINGS_CACHE[$id]; } @@ -102,10 +95,7 @@ function get_metastring($id) { $row = get_data_row("SELECT * from {$CONFIG->dbprefix}metastrings where id='$id' limit 1"); if ($row) { $METASTRINGS_CACHE[$id] = $row->string; // Cache it - - if ($CONFIG->debug) { - error_log("** Cacheing string '{$row->string}'"); - } + elgg_log("** Cacheing string '{$row->string}'"); return $row->string; } -- cgit v1.2.3