Class WebConsole

java.lang.Object
org.htmlunit.WebConsole
All Implemented Interfaces:
Serializable, org.htmlunit.corejs.javascript.NativeConsole.ConsolePrinter

public class WebConsole extends Object implements org.htmlunit.corejs.javascript.NativeConsole.ConsolePrinter, Serializable
This class can be used to print messages to the logger. The first parameter can be a message-object containing format specifiers such as ("%o", "%s", "%d", "%i", "%f"). The logging methods are null-safe, so if the number of format specifiers and the numbers of parameters don't match, no exception is thrown.

The default logger uses Apache Commons Logging.

See Also:
  • Field Details

  • Constructor Details

    • WebConsole

      public WebConsole()
  • Method Details

    • setLogger

      public void setLogger(WebConsole.Logger logger)
      Sets the Logger_.
      Parameters:
      logger - the logger
    • getLogger

      public WebConsole.Logger getLogger()
      Returns the current Logger.
      Returns:
      the logger
    • print

      public void print(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.NativeConsole.Level level, Object[] args, org.htmlunit.corejs.javascript.ScriptStackElement[] stack)
      Specified by:
      print in interface org.htmlunit.corejs.javascript.NativeConsole.ConsolePrinter
    • format

      private String format(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.Scriptable scope, Object[] args)