Closed BHoggs closed 7 months ago
Hey @BHoggs thank you for reporting on this
The fix should be something like - temporarily setting the Logger.disabled
flag to true only for the duration of the provided function (fn). After the function execution is complete, the original mute state is restored.
It will be a nice contribution :)
@Saarett FYI
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the bug It appears the intent of
MuteOutputBlock()
is to run certain debug functions and surpress their output, however the current implementation has the side effect of muting all output from all other operations.I noticed this as I was getting inconsistent warning messages when yor is running. This appears to be because they're getting surpressed while another go routine is using
MuteOutputBlock()
https://github.com/bridgecrewio/yor/blob/3e30ff383f4bde7b818626da5c77f0372ba1675e/src/common/logger/logging_service.go#L120C34-L120C34
To Reproduce Steps to reproduce the behavior:
yor tag --tag-local-modules -d .
Expected behavior I expect to get the same warning outputs each time I run yor on the same code
Desktop (please complete the following information):
Additional context Add any other context about the problem here (e.g. code snippets). https://github.com/bridgecrewio/yor/blob/3e30ff383f4bde7b818626da5c77f0372ba1675e/src/common/logger/logging_service.go#L120C34-L120C34