Skip to content

Commit b657360

Browse files
brettlangdongithub-actions[bot]
authored andcommitted
fix(subprocess): simplify subprocess debug logging messages (#13186)
## Checklist - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) --------- Co-authored-by: erikayasuda <[email protected]> (cherry picked from commit 7367467)
1 parent 95dc005 commit b657360

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

Diff for: ddtrace/contrib/internal/subprocess/patch.py

+5-11
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,7 @@ def _traced_ossystem(module, pin, wrapped, instance, args, kwargs):
345345
span.set_tag_str(COMMANDS.EXIT_CODE, str(ret))
346346
return ret
347347
except Exception: # noqa:E722
348-
log.debug(
349-
"Could not trace subprocess execution for os.system: [args: %s kwargs: %s]", args, kwargs, exc_info=True
350-
)
348+
log.debug("Could not trace subprocess execution for os.system", exc_info=True)
351349
return wrapped(*args, **kwargs)
352350

353351

@@ -362,9 +360,7 @@ def _traced_fork(module, pin, wrapped, instance, args, kwargs):
362360
ret = wrapped(*args, **kwargs)
363361
return ret
364362
except Exception: # noqa:E722
365-
log.debug(
366-
"Could not trace subprocess execution for os.fork*: [args: %s kwargs: %s]", args, kwargs, exc_info=True
367-
)
363+
log.debug("Could not trace subprocess execution for os.fork", exc_info=True)
368364
return wrapped(*args, **kwargs)
369365

370366

@@ -391,9 +387,7 @@ def _traced_osspawn(module, pin, wrapped, instance, args, kwargs):
391387
span.set_tag_str(COMMANDS.EXIT_CODE, str(ret))
392388
return ret
393389
except Exception: # noqa:E722
394-
log.debug(
395-
"Could not trace subprocess execution for os.spawn*: [args: %s kwargs: %s]", args, kwargs, exc_info=True
396-
)
390+
log.debug("Could not trace subprocess execution for os.spawn", exc_info=True)
397391

398392
return wrapped(*args, **kwargs)
399393

@@ -428,7 +422,7 @@ def _traced_subprocess_init(module, pin, wrapped, instance, args, kwargs):
428422
core.set_item(COMMANDS.CTX_SUBP_LINE, shellcmd.as_list())
429423
core.set_item(COMMANDS.CTX_SUBP_BINARY, shellcmd.binary)
430424
except Exception: # noqa:E722
431-
log.debug("Could not trace subprocess execution: [args: %s kwargs: %s]", args, kwargs, exc_info=True)
425+
log.debug("Could not trace subprocess execution", exc_info=True)
432426

433427
return wrapped(*args, **kwargs)
434428

@@ -455,5 +449,5 @@ def _traced_subprocess_wait(module, pin, wrapped, instance, args, kwargs):
455449
span.set_tag_str(COMMANDS.EXIT_CODE, str(ret))
456450
return ret
457451
except Exception: # noqa:E722
458-
log.debug("Could not trace subprocess execution [args: %s kwargs: %s]", args, kwargs, exc_info=True)
452+
log.debug("Could not trace subprocess execution", exc_info=True)
459453
return wrapped(*args, **kwargs)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
fixes:
3+
- |
4+
subprocess: Removes unnecessary debug log variables.

0 commit comments

Comments
 (0)