Class UserBrowserLogHandler


  • public class UserBrowserLogHandler
    extends java.util.logging.StreamHandler
    A user-specific log handler which stores the selenium browser log in memory.
    • Constructor Summary

      Constructors 
      Constructor Description
      UserBrowserLogHandler​(int userNumber)
      Create a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.String> getFormattedLogLines​(boolean clearLog)
      Get the lines of the log.
      int getNumberOfLogLines()
      Get the number of stored log lines.
      int getUserNumber()
      Get the simulated user number, as passed by the constructor.
      void publish​(java.util.logging.LogRecord logRecord)
      Implements the log handler, but stores the log record in memory only.
      • Methods inherited from class java.util.logging.StreamHandler

        close, flush, isLoggable, setEncoding
      • Methods inherited from class java.util.logging.Handler

        getEncoding, getErrorManager, getFilter, getFormatter, getLevel, setErrorManager, setFilter, setFormatter, setLevel
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UserBrowserLogHandler

        public UserBrowserLogHandler​(int userNumber)
        Create a new instance.
        Parameters:
        userNumber - the simulated user number, or -1 if no such information is available
    • Method Detail

      • publish

        public void publish​(java.util.logging.LogRecord logRecord)
        Implements the log handler, but stores the log record in memory only.
        Overrides:
        publish in class java.util.logging.StreamHandler
        Parameters:
        logRecord - the received log record
        See Also:
        getFormattedLogLines(boolean)
      • getUserNumber

        public int getUserNumber()
        Get the simulated user number, as passed by the constructor.
        Returns:
        the simulated user number, or -1 if no such information is available
      • getNumberOfLogLines

        public int getNumberOfLogLines()
        Get the number of stored log lines.
        Returns:
        the number of stored log lines
      • getFormattedLogLines

        public java.util.List<java.lang.String> getFormattedLogLines​(boolean clearLog)
        Get the lines of the log.
        Parameters:
        clearLog - if true = clear the stored log records after this method is called
        Returns:
        the lines of the log