Dean Hiller
Dean Hiller

Reputation: 20200

Java api for asking "Am I in debug mode?"

We would like our platform code to automatically adjust all timeouts to infinite if we are in debug mode so timeouts don't happen. Is there a way to ask java "Am I in debug mode?"

thanks, Dean

Upvotes: 0

Views: 55

Answers (1)

mentallurg
mentallurg

Reputation: 5207

The link in the comment may be fine in many cases.

  1. But sometimes it may be needed to debug the application behaviour after timeout occurred. For instance, to understand why the retry logic (that is executed only after timeout) doesn't work as expected.

  2. On the development environment the application might be running all the time in debug mode with the goal to be ready for remote debugging at any time, without restarting the application.

That's why I'd suggest to define timeouts via another properties file or via system properties.

Upvotes: 2

Related Questions