DataDog / orchestrion

Automatic compile-time instrumentation of Go code
http://datadoghq.dev/orchestrion/
Apache License 2.0
130 stars 4 forks source link

fix: propagate --log-level and --log-file to child processes #224

Closed nsrip-dd closed 1 month ago

nsrip-dd commented 1 month ago

What does this PR do?

If the log level is set via --log-level, set the corresponding environment variables so that the child processes will get it. This was done for --log-file already, but only if it was originally a relative path. Propagate it always.

Motivation

I noticed this when investigating #223. I was setting the log level to "trace" via the command line and didn't see much output. It took me a bit to realize that the setting wasn't picked up by all the workers. I set the env var instead, but ideally the command line argument works the same way :)

Reviewer's Checklist

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 61.50%. Comparing base (6bf164e) to head (03d085e). Report is 2 commits behind head on main.

Files Patch % Lines
main.go 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #224 +/- ## ========================================== - Coverage 61.51% 61.50% -0.02% ========================================== Files 90 90 Lines 4914 4915 +1 ========================================== Hits 3023 3023 - Misses 1568 1569 +1 Partials 323 323 ``` | [Flag](https://app.codecov.io/gh/DataDog/orchestrion/pull/224/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | Coverage Δ | | |---|---|---| | [ARM64](https://app.codecov.io/gh/DataDog/orchestrion/pull/224/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `44.68% <0.00%> (-0.02%)` | :arrow_down: | | [Linux](https://app.codecov.io/gh/DataDog/orchestrion/pull/224/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `66.13% <0.00%> (-0.02%)` | :arrow_down: | | [Windows](https://app.codecov.io/gh/DataDog/orchestrion/pull/224/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `43.56% <0.00%> (-0.02%)` | :arrow_down: | | [X64](https://app.codecov.io/gh/DataDog/orchestrion/pull/224/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `61.50% <0.00%> (-0.02%)` | :arrow_down: | | [generator](https://app.codecov.io/gh/DataDog/orchestrion/pull/224/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `42.71% <ø> (ø)` | | | [go1.22](https://app.codecov.io/gh/DataDog/orchestrion/pull/224/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `50.96% <0.00%> (-0.02%)` | :arrow_down: | | [go1.23](https://app.codecov.io/gh/DataDog/orchestrion/pull/224/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `49.74% <0.00%> (-0.02%)` | :arrow_down: | | [integration](https://app.codecov.io/gh/DataDog/orchestrion/pull/224/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `46.19% <0.00%> (-0.02%)` | :arrow_down: | | [macOS](https://app.codecov.io/gh/DataDog/orchestrion/pull/224/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `44.68% <0.00%> (-0.02%)` | :arrow_down: | | [unit](https://app.codecov.io/gh/DataDog/orchestrion/pull/224/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `40.00% <0.00%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.