Skip to content

Commit b5abefe

Browse files
committed
feat: add result collection debug logging
Add debug output before each result fetch showing: - Current offset position - Configured limit (page size) - Total events collected so far This provides visibility into the result collection loop when troubleshooting search behavior. Output uses distinct sourcetype 'goatsearch:debug' for easy filtering. Zero overhead when debug=False.
1 parent b1bb7bc commit b5abefe

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

bin/goatsearch.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,15 @@ def generate(self):
354354

355355
# TODO: We have to account for the fact these results may be out of time-order.
356356

357+
if self.debug:
358+
yield {
359+
"_raw": json.dumps({"url": results_uri}),
360+
"_time": time.time(),
361+
"source": "goatsearch",
362+
"sourcetype": "goatsearch:debug",
363+
"host": "localhost"
364+
}
365+
357366
self.headers['Accept'] = 'application/x-nd-json'
358367

359368
results_chunk = requests.get(

0 commit comments

Comments
 (0)