diff --git a/src/zm_db.cpp b/src/zm_db.cpp index f659bb361..e3b737c07 100644 --- a/src/zm_db.cpp +++ b/src/zm_db.cpp @@ -255,7 +255,7 @@ void zmDbQueue::process() { Logger *log = Logger::fetch(); Logger::Level db_level = log->databaseLevel(); log->databaseLevel(Logger::NOLOG); - Warning("db queue size has grown larger than 10 entries"); + Warning("db queue size has grown larger %zu than 10 entries", mQueue.size()); log->databaseLevel(db_level); } std::string sql = mQueue.front(); diff --git a/src/zm_event.cpp b/src/zm_event.cpp index adda18655..14b0fc9a3 100644 --- a/src/zm_event.cpp +++ b/src/zm_event.cpp @@ -479,7 +479,7 @@ void Event::AddFrame(Image *image, Debug(1, "Writing snapshot"); WriteFrameImage(image, timestamp, snapshot_file.c_str()); } else { - Debug(1, "Not Writing snapshot"); + Debug(1, "Not Writing snapshot because score %d > max %d", score, max_score); } // We are writing an Alarm frame @@ -491,7 +491,7 @@ void Event::AddFrame(Image *image, Debug(1, "Writing alarm image"); WriteFrameImage(image, timestamp, alarm_file.c_str()); } else { - Debug(1, "Not Writing alarm image"); + Debug(3, "Not Writing alarm image because alarm frame already written"); } if (alarm_image and (save_jpegs & 2)) { diff --git a/web/ajax/events.php b/web/ajax/events.php index 6d87da869..4e364242a 100644 --- a/web/ajax/events.php +++ b/web/ajax/events.php @@ -239,15 +239,17 @@ function queryRequest($filter, $search, $advsearch, $sort, $offset, $order, $lim } # end if search $sql = 'SELECT ' .$col_str. ' FROM `Events` AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE '.$search_filter->sql().' ORDER BY ' .$sort. ' ' .$order; - ZM\Debug('Calling the following sql query: ' .$sql); $filtered_rows = dbFetchAll($sql); - ZM\Debug('Have ' . count($filtered_rows) . ' events matching search filter.'); + ZM\Debug('Have ' . count($filtered_rows) . ' events matching search filter: '.$sql); } else { $filtered_rows = $unfiltered_rows; } # end if search_filter->terms() > 1 + if ($limit) + $filtered_rows = array_slice($filtered_rows, $offset, $limit); + $returned_rows = array(); - foreach ( array_slice($filtered_rows, $offset, $limit) as $row ) { + foreach ($filtered_rows as $row) { $event = new ZM\Event($row); $scale = intval(5*100*ZM_WEB_LIST_THUMB_WIDTH / $event->Width());