There are some paths that I want to throw an Exception when I'm working / debugging, but pass (and Log an error) when in Release.
This means:
- while working/debugging I can investigate the call stack when this happens
- this is mainly a cosmetic issue, so in Release people will just see an ugly text instead of the whole application crashing.
Is there already a builtin concept for this? Or any "word" that I can look for?
I know about Asserts, but as far as I know they are completely stripped on Release for performance reasons.
I just want this case to Log on Release.
I am mainly working in C#, but I can imagine this ia general concept.
If there is nothing there I can quite easily built it myself, but I prefer using industry standards.
Debugger.IsAttached(learn.microsoft.com/en-us/dotnet/api/…) may do what you need.Debugger.Break()if you just want to break and inspect things without throwing an Exception.#if DEBUG ...