org.olat.core.logging
Class JavaScriptTracingController

java.lang.Object
  extended by org.olat.core.gui.control.DefaultController
      extended by org.olat.core.gui.control.controller.BasicController
          extended by org.olat.core.logging.JavaScriptTracingController
All Implemented Interfaces:
Controller, ControllerEventListener, Disposable

public class JavaScriptTracingController
extends BasicController

Description:

The java script tracing controller allows logging java script messages to the server console. This is very handy to not use stupid alert() messages all over your javascript code.

In addition, you can leave some helpful debugging messages in the code if you need to do some real-time debugging.

When the log4j log level for this class is set to debug, all java script debug messages will be logged to the system console. While development, it can be usefull to set the debug level for this class to debug by default (webapp/WEB-INF/log4j.properties):

log4j.logger.org.olat.core.logging.JavaScriptTracingController=DEBUG

JS Example:

[...] if (B_AjaxLogger.isDebugEnabled()) { // always test if in log debug before loggin!! B_AjaxLogger.logDebug("This is a cool ajaxified debug message", "myjsfile.js"); } [...]

Initial Date: 09.07.2007

Author:
Florian Gnaegi, frentix GmbH, http://www.frentix.com

Constructor Summary
JavaScriptTracingController(UserRequest ureq, WindowControl wControl)
          Constructor for the javascript tracing.
 
Method Summary
 void event(UserRequest ureq, Component source, Event event)
          abstract event method for subclasses.
 
Methods inherited from class org.olat.core.gui.control.DefaultController
addControllerListener, addLoggingResourceable, dispatchEvent, dispatchEvent, dispose, getControllerCount, getInitialComponent, getUserActivityLogger, getWindowControlForDebug, isDisposed, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaScriptTracingController

public JavaScriptTracingController(UserRequest ureq,
                                   WindowControl wControl)
Constructor for the javascript tracing. This uses ajax to push js debug messages to the OLAT console.

DO NOT USE THIS CONTROLLER! Only the chief conroller should use this controller. In your code you can use the B_AjaxLogger directly without dealing with any java code at all!

Parameters:
ureq -
wControl -
Method Detail

event

public void event(UserRequest ureq,
                  Component source,
                  Event event)
Description copied from class: DefaultController
abstract event method for subclasses. the event received from the component we are listening to are always rerouted to this method here, except when the component has been disposed, in which case the events are simply ignored.

See Also:
DefaultController.event(org.olat.core.gui.UserRequest, org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)