Interface Logger


public interface Logger
Interface definition for a logger object to be used for logging important events and/or traffic between the remote system and the SDK.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns a unique id that can be used to track logs and traffic data of one session.
    boolean
    Indicates whether logging is enabled or not.
    void
    log(String function, String message)
    Writes a log entry.
    void
    log(String function, String message, Exception exception)
    Writes a log entry with exception trace.
    void
    logTraffic(int sessionId, boolean isRead, byte[] buffer, int offset, int count)
    Logs a read or write operation.
    void
    setEnabled(boolean enabled)
    Enables or disables logging.
  • Method Details

    • isEnabled

      boolean isEnabled()
      Indicates whether logging is enabled or not.
      Returns:
      true if logging is enabled, otherwise false.
    • setEnabled

      void setEnabled(boolean enabled)
      Enables or disables logging.
      Parameters:
      enabled - true to enable logging, false otherwise.
    • getNextUniqueSessionId

      int getNextUniqueSessionId()
      Returns a unique id that can be used to track logs and traffic data of one session. This method is called by the DataManSystem object when a connection is being established.
      Returns:
      A new unique id that can be used to distinguish logs and traffic data of different communication sessions.
    • log

      void log(String function, String message)
      Writes a log entry.
      Parameters:
      function - Name of the function for which the log entry is created.
      message - The log message.
    • log

      void log(String function, String message, Exception exception)
      Writes a log entry with exception trace.
      Parameters:
      function - Name of the function for which the log entry is created.
      message - The log message.
      exception - The exception object to trace
    • logTraffic

      void logTraffic(int sessionId, boolean isRead, byte[] buffer, int offset, int count)
      Logs a read or write operation.
      Parameters:
      sessionId - The unique id of the session to which this log belong.
      isRead - true in case of a read operation, false in case of a write operation.
      buffer - Buffer that contains the bytes that were read/written.
      offset - Offset in the buffer to log from.
      count - Number of bytes to write to the log from the buffer.