microsoft / wil

Windows Implementation Library
MIT License
2.57k stars 234 forks source link

Return failed HRESULT, log failure but don't send telemetry #425

Closed araujoarthur0 closed 7 months ago

araujoarthur0 commented 8 months ago

For the result macros, when one sets a telemetry fallback provider with SetResultTelemetryFallback() and a logging callback with SetResultLoggingCallback(), we always log and send telemetry for HRESULT failures in the RETURN_ macros. The _EXPECTED macros allows one to skip the reporting for some expected HRESULTs, but that suppresses both logging and telemetry.

Is there a way to suppress only telemetry for expected scenarios, but still get logging?

The scenario is when you don't want the telemetry to have expected errors, but they still help in debugging when looking at a local log.

dunhor commented 7 months ago

From what I recall, this question has come up a couple times in the past and from what I remember, no it's not possible. Someone like @ChrisGuzak can hopefully provide more commentary/history here.