Package com.helger.commons.debug
Class GlobalDebug
- java.lang.Object
-
- com.helger.commons.debug.GlobalDebug
-
@ThreadSafe public final class GlobalDebug extends Object
Global class for handling the following typical application modes:- trace
- debug
- production
- Author:
- Philip
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_DEBUG_MODEBy default debug mode is enabledstatic booleanDEFAULT_PRODUCTION_MODEBy default production mode is disablestatic booleanDEFAULT_SILENT_MODEBy default silent mode is enabled.static StringSYSTEM_PROPERTY_JAVA_SECURITY_DEBUGstatic StringSYSTEM_PROPERTY_JAVAX_ACTIVATION_DEBUGstatic StringSYSTEM_PROPERTY_JAVAX_NET_DEBUGstatic StringSYSTEM_PROPERTY_JAXP_DEBUGstatic StringSYSTEM_PROPERTY_MAIL_DEBUGstatic StringSYSTEM_PROPERTY_SERIALIZATION_DEBUG
-
Constructor Summary
Constructors Constructor Description GlobalDebug()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanisDebugMode()static booleanisProductionMode()voidsetDebugMode(boolean bDebugMode)static voidsetDebugModeDirect(boolean bDebugMode)Enable or disable debug mode.static voidsetJavaCommonComponentsDebugMode(boolean bDebugMode)Set the debug mode for the common Java components: JAXP Javax Activation Javax Mailstatic voidsetJavaNetDebugMode(String sValue)Enable or disable Java net debugging.static voidsetJavaSecurityDebugMode(String sValue)Enable or disable Java security debugging.voidsetProductionMode(boolean bProductionMode)static voidsetProductionModeDirect(boolean bProductionMode)Enable or disable production mode.
-
-
-
Field Detail
-
DEFAULT_DEBUG_MODE
public static final boolean DEFAULT_DEBUG_MODE
By default debug mode is enabled- See Also:
- Constant Field Values
-
DEFAULT_PRODUCTION_MODE
public static final boolean DEFAULT_PRODUCTION_MODE
By default production mode is disable- See Also:
- Constant Field Values
-
DEFAULT_SILENT_MODE
public static final boolean DEFAULT_SILENT_MODE
By default silent mode is enabled.- Since:
- 9.4.0
- See Also:
- Constant Field Values
-
SYSTEM_PROPERTY_MAIL_DEBUG
public static final String SYSTEM_PROPERTY_MAIL_DEBUG
- See Also:
- Constant Field Values
-
SYSTEM_PROPERTY_JAVA_SECURITY_DEBUG
public static final String SYSTEM_PROPERTY_JAVA_SECURITY_DEBUG
- See Also:
- Constant Field Values
-
SYSTEM_PROPERTY_JAVAX_ACTIVATION_DEBUG
public static final String SYSTEM_PROPERTY_JAVAX_ACTIVATION_DEBUG
- See Also:
- Constant Field Values
-
SYSTEM_PROPERTY_JAVAX_NET_DEBUG
public static final String SYSTEM_PROPERTY_JAVAX_NET_DEBUG
- See Also:
- Constant Field Values
-
SYSTEM_PROPERTY_JAXP_DEBUG
public static final String SYSTEM_PROPERTY_JAXP_DEBUG
- See Also:
- Constant Field Values
-
SYSTEM_PROPERTY_SERIALIZATION_DEBUG
public static final String SYSTEM_PROPERTY_SERIALIZATION_DEBUG
- See Also:
- Constant Field Values
-
-
Method Detail
-
setDebugMode
public void setDebugMode(boolean bDebugMode)
-
setProductionMode
public void setProductionMode(boolean bProductionMode)
-
setJavaCommonComponentsDebugMode
public static void setJavaCommonComponentsDebugMode(boolean bDebugMode)
Set the debug mode for the common Java components:- JAXP
- Javax Activation
- Javax Mail
- Parameters:
bDebugMode-trueto enable debug mode,falseto disable it
-
setJavaNetDebugMode
public static void setJavaNetDebugMode(@Nullable String sValue)
Enable or disable Java net debugging.- Parameters:
sValue- Debug property value. Valid values are:null- all
- ssl
- ssl:xxx (see Java docs what xxx can be)
- Since:
- 8.6.1
-
setJavaSecurityDebugMode
public static void setJavaSecurityDebugMode(@Nullable String sValue)
Enable or disable Java security debugging.- Parameters:
sValue- Debug property value. Valid values are:null- all
- access
- certpath
- combiner
- gssloginconfig
- configfile
- configparser
- jar
- logincontext
- policy
- provider
- scl
- Since:
- 8.6.1
-
setDebugModeDirect
public static void setDebugModeDirect(boolean bDebugMode)
Enable or disable debug mode. If debug mode is disabled, also trace mode is disabled.- Parameters:
bDebugMode-trueto enable,falseto disable
-
setProductionModeDirect
public static void setProductionModeDirect(boolean bProductionMode)
Enable or disable production mode. If production mode is enabled, also trace mode and debug mode are disabled.- Parameters:
bProductionMode-trueto enable,falseto disable
-
isDebugMode
public static boolean isDebugMode()
- Returns:
trueif debug mode is active,falseif not
-
isProductionMode
public static boolean isProductionMode()
- Returns:
trueif production mode is active,falseif not
-
-