Skip to content

Commit 7367467

Browse files
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]>
1 parent 73764dc commit 7367467

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

ddtrace/contrib/internal/subprocess/patch.py

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

352350

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

369365

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

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

@@ -426,7 +420,7 @@ def _traced_subprocess_init(module, pin, wrapped, instance, args, kwargs):
426420
core.set_item(COMMANDS.CTX_SUBP_LINE, shellcmd.as_list())
427421
core.set_item(COMMANDS.CTX_SUBP_BINARY, shellcmd.binary)
428422
except Exception: # noqa:E722
429-
log.debug("Could not trace subprocess execution: [args: %s kwargs: %s]", args, kwargs, exc_info=True)
423+
log.debug("Could not trace subprocess execution", exc_info=True)
430424

431425
return wrapped(*args, **kwargs)
432426

@@ -452,5 +446,5 @@ def _traced_subprocess_wait(module, pin, wrapped, instance, args, kwargs):
452446
span.set_tag_str(COMMANDS.EXIT_CODE, str(ret))
453447
return ret
454448
except Exception: # noqa:E722
455-
log.debug("Could not trace subprocess execution [args: %s kwargs: %s]", args, kwargs, exc_info=True)
449+
log.debug("Could not trace subprocess execution", exc_info=True)
456450
return wrapped(*args, **kwargs)
Lines changed: 4 additions & 0 deletions
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)