You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We have already made some tradeoffs around accepting incorrect configuration or data without blowing the SDK up. For example using getCurrentSpan with NopScopeManager or passing different format to inject(). I expect we will log warnings or errors about these edge cases, but I could imagine an extra strict (default: false) option that would throw instead of logging and could be used for testing.
In OpenCensus I found challenging sometimes to figure out why my traces are broken when I did something wrong.
Describe the solution you'd like strict option (default: false) that would throw instead of logging.
logInconsistency(msg){if(this.config.strict){thrownewError(msg)}this.logger.error(msg);}getCurrentSpan(): types.Span{if(this.scopeManagerinstanceofNopScopeManager){this.logInconsistency('NopScopeManager does not support getCurrentSpan()');}returnTracerBase.defaultSpan;}
Describe alternatives you've considered
Just logging.
The text was updated successfully, but these errors were encountered:
Related to this, I would like to have the option to make it so that no logging takes place in a production browser context (console.log statements don't really help your end user), and even so that all logging could be stripped out by optimizing compilers like Closure.
I think making the logging utilities live under the platform folder and respond to some global config could enable both of these use cases.
We haven't set a clear rule about when to throw and when to log the error. Since we’re GA we don’t want to change any of the current behavior.
As a general rule, we should throw on the startup/configuration phase and log the error during runtime to avoid breaking users.
Is your feature request related to a problem? Please describe.
We have already made some tradeoffs around accepting incorrect configuration or data without blowing the SDK up. For example using
getCurrentSpan
withNopScopeManager
or passing different format toinject()
. I expect we will log warnings or errors about these edge cases, but I could imagine an extrastrict
(default: false) option that would throw instead of logging and could be used for testing.In OpenCensus I found challenging sometimes to figure out why my traces are broken when I did something wrong.
Describe the solution you'd like
strict
option (default: false) that wouldthrow
instead of logging.Describe alternatives you've considered
Just logging.
The text was updated successfully, but these errors were encountered: