![](https://www.devx.com/wp-content/uploads/img-src/devx/7238/bugtracking2.jpg)
Write Debug Information Only When a Condition is Satisfied
The Debug.WriteIf?method allows you to write the debug to the listener only when a condition is true. See below for an example. Debug.WriteLineIc(counter ==100, “you have reached a maximum”);