com.microfocus.awm.core

## Class AWMLoggingUtility

- java.lang.Object
- - com.microfocus.awm.core.AWMLoggingUtility

-     public class AWMLoggingUtility
      extends java.lang.Object

  Helper methods for logging or tracing information.
  Author:
    Micro Focus

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AWMLoggingUtility()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `getMaskedPropertyValue(IPropertyValue pPropValue)` Returns the string value of a given `IPropertyValue`, but returns `"**********"` if the property type is `ETypes.PASSWORD`.
    `static java.lang.String` | `getMaskedPropertyValue(Property pProperty, java.lang.String pValue)` Returns the string value of a given `Property`, but returns `"**********"` if the property type is `ETypes.PASSWORD`.
    `static boolean` | `isAwmDebugEnabled()` Checks for the debug flag of the TAURUS Plug-In.
    `static void` | `logError(java.lang.String pString, java.lang.Exception pE)` Logs an Error with the given messages, which will be visible in the Eclipse Error Log View.
    `static void` | `logError(java.lang.String pString, java.lang.Exception pE, int pSeverity)` Logs an Error with the given messages and severity, which will be visible in the Eclipse Error Log View.
    `static void` | `traceMessage(java.lang.String pMsg)` Creates a log message if AWM debugging is turned on.
    `static void` | `traceMessage(java.lang.String pMsg, boolean pForceTrace)` Creates a log message if AWM debugging is turned on or the force flag is set to `true`.
    `static void` | `traceMessage(java.lang.String pMsg, int pSeverity)` Creates a log message if AWM debugging is turned on.
    `static void` | `traceMessage(java.lang.String pMsg, int pSeverity, boolean pForce)` Creates a log message if AWM debugging is turned on or the force flag is set to `true`.
    `static void` | `traceStatus(org.eclipse.core.runtime.IStatus pStatus, boolean pForce)` Logs an `IStatus` if AWM debugging is turned on or the force flag is set to `true`.

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

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

- - ### Constructor Detail

    - #### AWMLoggingUtility

          public AWMLoggingUtility()

  - ### Method Detail

    - #### isAwmDebugEnabled

          public static boolean isAwmDebugEnabled()

      Checks for the debug flag of the TAURUS Plug-In.
      Returns:
        `true` if both debug flags of the `com.microfocus.awm` Plug-In have been enabled

    - #### traceMessage

          public static void traceMessage(java.lang.String pMsg,
                                          int pSeverity,
                                          boolean pForce)

      Creates a log message if AWM debugging is turned on or the force flag is set to `true`.
      Parameters:
        `pMsg` - the message to log.
        `pSeverity` - `IStatus.INFO`, `IStatus.WARNING` or `IStatus.ERROR`
        `pForce` - whether to trace the message even if debug is disabled

    - #### traceStatus

          public static void traceStatus(org.eclipse.core.runtime.IStatus pStatus,
                                         boolean pForce)

      Logs an `IStatus` if AWM debugging is turned on or the force flag is set to `true`.
      Parameters:
        `pStatus` - the status to log
        `pForce` - whether to trace the message even if debug is disabled

    - #### logError

          public static void logError(java.lang.String pString,
                                      java.lang.Exception pE,
                                      int pSeverity)

      Logs an Error with the given messages and severity, which will be visible in the Eclipse Error Log View.
      Parameters:
        `pString` - a user-readable message
        `pE` - the exception
        `pSeverity` - the severity (`IStatus` constants)
      See Also:
        `logError(String, Exception)`

    - #### logError

          public static void logError(java.lang.String pString,
                                      java.lang.Exception pE)

      Logs an Error with the given messages, which will be visible in the Eclipse Error Log View.
      Parameters:
        `pString` - a user-readable message
        `pE` - the exception
      See Also:
        `logError(String, Exception, int)`

    - #### traceMessage

          public static void traceMessage(java.lang.String pMsg)

      Creates a log message if AWM debugging is turned on.

      Same as calling `traceMessage(pMsg, IStatus.INFO, false)`.

      Parameters:
        `pMsg` - the message to log.

    - #### traceMessage

          public static void traceMessage(java.lang.String pMsg,
                                          boolean pForceTrace)

      Creates a log message if AWM debugging is turned on or the force flag is set to `true`.

      Same as calling `traceMessage(pMsg, IStatus.INFO, pForceTrace)`.

      Parameters:
        `pMsg` - the message to log.
        `pForceTrace` - option to force the tracing

    - #### traceMessage

          public static void traceMessage(java.lang.String pMsg,
                                          int pSeverity)

      Creates a log message if AWM debugging is turned on.

      Same as calling `traceMessage(pMsg, pSeverity, false)`.

      Parameters:
        `pMsg` - the message to log.
        `pSeverity` - `IStatus.INFO`, `IStatus.WARNING` or `IStatus.ERROR`
      See Also:
        `traceMessage(String)`

    - #### getMaskedPropertyValue

          public static java.lang.String getMaskedPropertyValue(IPropertyValue pPropValue)

      Returns the string value of a given `IPropertyValue`, but returns `"**********"` if the property type is `ETypes.PASSWORD`.

      This is intended to prevent potential password property values to appear in traces, logs or other sensitive locations.

      Parameters:
        `pPropValue` - a property value
      Returns:
        - `null` if the given property value or its string value is `null`.
        - Same as `IPropertyValue.getValue()` if the property type is not `PASSWORD`.
        - `"**********"` if the property value type is `PASSWORD`.

    - #### getMaskedPropertyValue

          public static java.lang.String getMaskedPropertyValue(Property pProperty,
                                                                java.lang.String pValue)

      Returns the string value of a given `Property`, but returns `"**********"` if the property type is `ETypes.PASSWORD`.

      This is intended to prevent potential password property values to appear in traces, logs or other sensitive locations.

      Parameters:
        `pProperty` - a property
        `pValue` - the `String` value of the property
      Returns:
        - `null` if the given property value or its string value is `null`.
        - Same as pValue if the property type is not `PASSWORD`.
        - `"**********"` if the property value type is `PASSWORD`.

Copyright © 2015 Micro Focus GmbH. All rights reserved.