DebugUtils
Date: 2017-01-22

org.apache.commons.exec.util

## Class DebugUtils

- java.lang.Object
- - org.apache.commons.exec.util.DebugUtils

-     public class DebugUtils
      extends java.lang.Object

  Provides debugging support.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `COMMONS_EXEC_DEBUG` System property to determine how to dump an exception.
    `static java.lang.String` | `COMMONS_EXEC_LENIENT` System property to determine how to handle exceptions.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DebugUtils()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `handleException(java.lang.String msg, java.lang.Exception e)` Handles an exception based on the system properties.
    `static boolean` | `isDebugEnabled()` Determines if debugging is enabled based on the system property "COMMONS_EXEC_DEBUG".
    `static boolean` | `isLenientEnabled()` Determines if lenient mode is enabled.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### COMMONS_EXEC_LENIENT

          public static final java.lang.String COMMONS_EXEC_LENIENT

      System property to determine how to handle exceptions. When set to "false" we rethrow the otherwise silently catched exceptions found in the original code. The default value is "true"
      See Also:
        Constant Field Values

    - #### COMMONS_EXEC_DEBUG

          public static final java.lang.String COMMONS_EXEC_DEBUG

      System property to determine how to dump an exception. When set to "true" we print any exception to stderr. The default value is "false"
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DebugUtils

          public DebugUtils()

  - ### Method Detail

    - #### handleException

          public static void handleException(java.lang.String msg,
                             java.lang.Exception e)

      Handles an exception based on the system properties.
      Parameters:
        `msg` - message describing the problem
        `e` - an exception being handled

    - #### isDebugEnabled

          public static boolean isDebugEnabled()

      Determines if debugging is enabled based on the system property "COMMONS_EXEC_DEBUG".
      Returns:
        true if debug mode is enabled

    - #### isLenientEnabled

          public static boolean isLenientEnabled()

      Determines if lenient mode is enabled.
      Returns:
        true if lenient mode is enabled