[geeklog-cvs] geeklog: Added a verbose logging option to the search class and ...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sat May 2 05:55:35 EDT 2009
details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/6c74bf38fcd5
changeset: 7011:6c74bf38fcd5
user: Dirk Haun <dirk at haun-online.de>
date: Sat May 02 11:09:55 2009 +0200
description:
Added a verbose logging option to the search class and make it default to off
diffstat:
2 files changed, 12 insertions(+), 3 deletions(-)
public_html/docs/history | 2 ++
system/classes/search.class.php | 13 ++++++++++---
diffs (56 lines):
diff -r d60bf2d05792 -r 6c74bf38fcd5 public_html/docs/history
--- a/public_html/docs/history Sat May 02 08:56:18 2009 +0200
+++ b/public_html/docs/history Sat May 02 11:09:55 2009 +0200
@@ -11,6 +11,8 @@
+ Comment moderation and editable comments, by Jared Wenerd
Other changes:
+- Added a verbose logging option to the search class and make it default to off
+ [Dirk]
- Fixed a typo that prevented the [staticpage:] autotag from working [Dirk]
diff -r d60bf2d05792 -r 6c74bf38fcd5 system/classes/search.class.php
--- a/system/classes/search.class.php Sat May 02 08:56:18 2009 +0200
+++ b/system/classes/search.class.php Sat May 02 11:09:55 2009 +0200
@@ -61,6 +61,7 @@
var $_append_query = array();
var $_searchURL = '';
var $_wordlength;
+ var $_verbose = false; // verbose logging
/**
* Constructor
@@ -572,7 +573,9 @@
$sql = $this->_convertsql($sql);
$debug_info .= "SQL = " . print_r($sql,1);
- COM_errorLog($debug_info);
+ if ($this->_verbose) {
+ COM_errorLog($debug_info);
+ }
$obj->setQuery($result->getLabel(), $result->getName(), $sql, $result->getRank());
$this->_url_rewrite[ $result->getName() ] = $result->UrlRewriteEnable();
@@ -585,7 +588,9 @@
$debug_info = $result->plugin_name . " using APIv1 with backwards compatibility.";
$debug_info .= " Count: " . $result->num_searchresults;
$debug_info .= " Headings: " . implode(",", $result->searchheading);
- COM_errorLog($debug_info);
+ if ($this->_verbose) {
+ COM_errorLog($debug_info);
+ }
// Find the column heading names that closely match what we are looking for
// There may be issues here on different languages, but this _should_ capture most of the data
@@ -641,7 +646,9 @@
}
// Find out how many plugins are on the old/new system
- COM_errorLog("Search Plugins using APIv1: $old_api APIv2: $new_api");
+ if ($this->_verbose) {
+ COM_errorLog("Search Plugins using APIv1: $old_api APIv2: $new_api");
+ }
// Execute the queries
$results = $obj->ExecuteQueries();
More information about the geeklog-cvs
mailing list