aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/metastrings.php
diff options
context:
space:
mode:
authornickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-10-16 22:53:22 +0000
committernickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-10-16 22:53:22 +0000
commita61b62e592380fa3be7e4ff812f3e514afabd321 (patch)
tree225b02b83766778bfbadb0db37b715a79d9c05b2 /engine/lib/metastrings.php
parent694781d190fba09437a37983f077d0381a56050b (diff)
downloadelgg-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/metastrings.php')
-rw-r--r--engine/lib/metastrings.php18
1 files changed, 4 insertions, 14 deletions
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;
}