Skip to content

Commit b8c8081

Browse files
committed
Add some debug logs to clarify what's going on
Signed-off-by: Pedro Algarvio <[email protected]>
1 parent 7ec6dbf commit b8c8081

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/ptscripts/parser.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ def install(self, ctx: Context) -> None:
157157
and requirements_hash_file.read_text() == self.requirements_hash
158158
):
159159
# Requirements are up to date
160-
ctx.debug("Base tools requirements haven't changed.")
160+
ctx.debug(
161+
f"Base tools requirements haven't changed. Hash file: '{requirements_hash_file}'; "
162+
f"Hash: '{self.requirements_hash}'"
163+
)
161164
return
162165
requirements = []
163166
if self.requirements_files:
@@ -177,6 +180,7 @@ def install(self, ctx: Context) -> None:
177180
)
178181
requirements_hash_file.parent.mkdir(parents=True, exist_ok=True)
179182
requirements_hash_file.write_text(self.requirements_hash)
183+
ctx.debug(f"Wrote '{requirements_hash_file}' with contents: '{self.requirements_hash}'")
180184

181185

182186
class Context:
@@ -294,6 +298,7 @@ def run(
294298
295299
Either in a virtualenv context if one was configured or the system context.
296300
"""
301+
self.debug(f"""Running '{" ".join(cmdline)}'""")
297302
try:
298303
if self.venv:
299304
return self.venv.run(
@@ -589,6 +594,8 @@ def parse_args(self) -> None:
589594
"""
590595
Parse CLI.
591596
"""
597+
# Log the argv getting executed
598+
self.context.debug(f"Tools executing 'sys.argv': {sys.argv}")
592599
# Process registered imports to allow other modules to register commands
593600
self._process_registered_tool_modules()
594601
options = self.parser.parse_args()

0 commit comments

Comments
 (0)