Skip to content

Commit c24b18d

Browse files
committed
test: set --log-level INFO in make test, add logging to browser tool
1 parent aaf5d9e commit c24b18d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ build:
88

99
test:
1010
@# if SLOW is not set, pass `-m "not slow"` to skip slow tests
11-
poetry run pytest ${SRCDIRS} -v --durations=5 \
11+
poetry run pytest ${SRCDIRS} -v --log-level INFO --durations=5 \
1212
--cov=gptme --cov-report=xml --cov-report=term-missing --cov-report=html \
1313
$(if $(SLOW),, -m "not slow") \
1414
$(if $(PROFILE), --profile-svg)

gptme/tools/browser.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def get_browser():
2121
"""
2222
global _p
2323
if _p is None:
24+
logger.info("Starting browser")
2425
_p = sync_playwright().start()
2526

2627
atexit.register(_p.stop)
@@ -40,6 +41,7 @@ def load_page(url: str) -> Page:
4041
)
4142

4243
# create a new page
44+
logger.info(f"Loading page: {url}")
4345
page = context.new_page()
4446
page.goto(url)
4547

@@ -48,6 +50,7 @@ def load_page(url: str) -> Page:
4850

4951
def search(query: str, engine: EngineType = "google") -> str:
5052
"""Search for a query on a search engine."""
53+
logger.info(f"Searching for '{query}' on {engine}")
5154
if engine == "google":
5255
return _search_google(query)
5356
elif engine == "duckduckgo":

0 commit comments

Comments
 (0)