summaryrefslogtreecommitdiff
path: root/src/search.cpp
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2024-03-17 15:04:35 +0100
committerAldrik Ramaekers <aldrikboy@gmail.com>2024-03-17 15:04:35 +0100
commit95e06b2f6d87b597a52029dbfa9896f4bd8ca74b (patch)
tree250078f1044844a8cfe64592a9181fa0587317ae /src/search.cpp
parent7105b39ca10394723e888161d586461e9e2b1984 (diff)
logging
Diffstat (limited to 'src/search.cpp')
-rw-r--r--src/search.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/search.cpp b/src/search.cpp
index 35e9a23..3622f28 100644
--- a/src/search.cpp
+++ b/src/search.cpp
@@ -1,6 +1,7 @@
#include "search.h"
#include "platform.h"
#include "config.h"
+#include "logging.h"
#include <stdio.h>
ts_search_result *current_search_result = NULL;
@@ -374,6 +375,8 @@ static void *_ts_list_files_thread(void *args)
ts_platform_list_files_block(info, NULL);
info->done_finding_files = true;
+ TS_LOG_TRACE("Search done listing files: %p", info);
+
// Use this thread to cleanup previous result.
if (info->prev_result) {
while (!info->prev_result->search_completed || info->prev_result->is_saving) {
@@ -388,6 +391,8 @@ static void *_ts_list_files_thread(void *args)
if (info->completed_match_threads == info->max_ts_thread_count) {
info->search_completed = true; // No memory is written after this point.
info->timestamp = ts_platform_get_time(info->timestamp);
+
+ TS_LOG_TRACE("Search completed: %p", info);
}
ts_thread_sleep(10);
}
@@ -407,6 +412,7 @@ void ts_start_search(utf8_int8_t *path, utf8_int8_t *filter, utf8_int8_t *query,
return;
}
+
if (current_search_result)
{
current_search_result->cancel_search = true;
@@ -420,6 +426,7 @@ void ts_start_search(utf8_int8_t *path, utf8_int8_t *filter, utf8_int8_t *query,
new_result->max_ts_thread_count = thread_count;
new_result->max_file_size = max_fs;
new_result->respect_capitalization = case_sensitive;
+ TS_LOG_TRACE("Search started: %p %s -> %s", new_result, path, query);
if (utf8len(query) == 0) {
new_result->search_text = NULL;