Search code examples
gitdebuggingforkbranchpreprocessor-directive

Best approach for implement temporary verbose logging for detect the cause of a concrete bug: branch, fork or preprocessor directive


One of our clients has detected a bug in our application and we cannot reproduce it in ours machines. Our application calls a lot of custom DLLs (these are ours) so as a first attempt trying to know what is happening we have decided to implement a verbose logging (logging is currently being done but not as much as detailed) to see the sequence of calls it is being done and then distribute this new setup to our clients in order client give us the log file so we can analyze it.

Since I need to implement a verbose logging only for this scenario as a "debug" version, which is the best way to proceed? doing a branch for this, doing a fork or using C# preprocessor directives. Taking into account that I don't think of incorporating this verbose loggings to our final application (as it is only for debug a concrete bug and I don't want to compromise the performance), which is the best approach I can do?


Solution

  • You can keep it in the main branch, but wrap it in a feature flag which allows you to activate the detailed logging whenever you want.

    That way, no need for branches or fork.