Class Logger

java.lang.Object
paypal.payflow.Logger

public final class Logger extends Object
This is a singleton class which can be used for logging of the messages. The logger will log all the messages to the file specified in the SDKproperties class. By default the logging will be switched to OFF.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Logger
    This will give the instance of the logger class.
    Get the Errors generated due to the Logger.
    boolean
    log(String message, int severityLvl)
    This method logs the data to a file.Different type of severity level can be logged here.
    protected void
    log(ArrayList messages)
    This is a internal method and takes in a arraylist of the errorobjects as a parameter.The method goes through the array list for each errorobject found makes a call to another overloaded version of the Log method which takes in ErrorObject as a parameter.If there are some errors which have been generated by the Logger class then those are logged instead of the passed messages.
    protected void
    log(ErrorObject message)
    This is a internal method and takes in a errorobject as a parameter.This method then calls another overloaded version for the method Log which takes in a string to be logged and the severity level of the Error Object.
    protected ArrayList
    This method populates each ErrorObject int the arraylist passed, with the details from the SortedList held by the logger class.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getInstance

      public static Logger getInstance()
      This will give the instance of the logger class.
      Returns:
      mInstance
    • getLoggerErrs

      public ArrayList getLoggerErrs()
      Get the Errors generated due to the Logger.
      Returns:
      mLoggerErrs
    • log

      protected void log(ErrorObject message)
      This is a internal method and takes in a errorobject as a parameter.This method then calls another overloaded version for the method Log which takes in a string to be logged and the severity level of the Error Object.
      Parameters:
      message - ErrorObject
    • log

      protected void log(ArrayList messages)
      This is a internal method and takes in a arraylist of the errorobjects as a parameter.The method goes through the array list for each errorobject found makes a call to another overloaded version of the Log method which takes in ErrorObject as a parameter.If there are some errors which have been generated by the Logger class then those are logged instead of the passed messages.
      Parameters:
      messages - ArrayList containing the error objects
    • log

      public boolean log(String message, int severityLvl)
      This method logs the data to a file.Different type of severity level can be logged here. The levels that can be logged are decided by the configuration settings in the SDKProperties file.
      Parameters:
      message - String : value that needs to be logged
      severityLvl - int : Severity level of the message.This could be one of the following:
      1. PayflowConstants.LOGGING_OFF
      2. PayflowConstants.SEVERITY_FATAL
      3. PayflowConstants.SEVERITY_ERROR
      4. PayflowConstants.SEVERITY_WARN
      5. PayflowConstants.SEVERITY_INFO
      6. PayflowConstants.SEVERITY_DEBUG
      Returns:
      retVal Boolean
    • populateErrorDetails

      protected ArrayList populateErrorDetails(ArrayList errObj)
      This method populates each ErrorObject int the arraylist passed, with the details from the SortedList held by the logger class. It populates the mLoggerErrs in case the relevant message code is not found. *

      Populate the error object with the details

      Parameters:
      errObj - ArrayList
      Returns:
      errorObject ArrayList