Package org.htmlunit

Class WebConsole

  • All Implemented Interfaces:
    java.io.Serializable, org.htmlunit.corejs.javascript.NativeConsole.ConsolePrinter

    public class WebConsole
    extends java.lang.Object
    implements org.htmlunit.corejs.javascript.NativeConsole.ConsolePrinter, java.io.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:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  WebConsole.Logger
      A simple logging interface abstracting logging APIs.
    • Constructor Summary

      Constructors 
      Constructor Description
      WebConsole()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      WebConsole.Logger getLogger()
      Returns the current Logger.
      void print​(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.NativeConsole.Level level, java.lang.Object[] args, org.htmlunit.corejs.javascript.ScriptStackElement[] stack)  
      void setLogger​(WebConsole.Logger logger)
      Sets the Logger_.
      • Methods inherited from class java.lang.Object

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

      • WebConsole

        public WebConsole()
    • Method Detail

      • 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,
                          java.lang.Object[] args,
                          org.htmlunit.corejs.javascript.ScriptStackElement[] stack)
        Specified by:
        print in interface org.htmlunit.corejs.javascript.NativeConsole.ConsolePrinter