When the debugger is used, various levels of messages will pop up when logged, or when logging a custom message, using something like bb.console.log('Hey, stop that!');
Are there any hooks or callbacks available whereby I could receive those messages into my own custom handler? And, if so, are those callbacks available when clientDebug="false"?

Interceptor
21 September, 2007 - 12:56 — isaHi Kwooda,
As far as I know, we do not support that functionality. You can not intercept, but you can use log4j for java side and firebug for client side if you need additional logging system.
I'm not sure if I got your point correctly, what are you excatly trying to achieve?
Isa
I want to catch client-side errors
21 September, 2007 - 19:40 — KwoodaSimple - I want to catch client-side messages. The underlying objective is to catch errors and relay them to the server where they can be logged. That way we can have some hard data to look at when troubleshooting, rather than relying on an end-user's interpretation of an error when one occurs.
In version 3.3.1 of your Client edition product, there is a message logging tool that reports messages at various levels (from critical to custom). I do not see this functionality in the 4.0.1 debugger with the JSF product. But there is a bb.console.log method you can call to log messages. Is there some functionality in there somewhere that is catching client-side messages (from critical to custom), other than through bb.console.log? We need a way to catch and record any client-side errors so that we can identify and correct problems in a reasonable time period, especially if we don't have access to a remote client installation and cannot reproduce a problem in-house.
Re: Intercept error/debug messages
26 September, 2007 - 17:22 — SergeyYes, you can actually subscribe to exceptions on client side of your application!
When an exception occurs (there are notice, warning and error level excpetions) an event is dispatched to the document. So, if you attach your own handler to the document that would listen to events of the type "exception" you could also react the way you wish.
Most interesting properties of this event interface for you would be:
"severity" (1 - notice, 2 - warning, 3 - error) that keeps the severity level of the exception and "description" that contains the message.
Please also be aware that exceptions of types notice and warning do not lead to the JS error thrown, while error exception will lead to the JS error anyway.
Example?
10 October, 2007 - 00:52 — KwoodaIs there an example of this somewhere?
Hi Kwooda,
21 December, 2007 - 11:00 — AlexanderHi Kwooda,
The following code snippets provide you with the basics of setting up your custom client error handler and send the errors to the server and do whatever you like with it. Within some Backbase JSF application you could use a Backbase JSF hidden input with a valueChangeListener and give it some id (clientErrorListener), like the following snippet:
<bjsf:inputHidden id="clientErrorListener"
binding="#{clientErrorCatcherBean.errorCatcher}"
value="Backbase input text"
valueChangeListener="#{clientErrorCatcherBean.errorCatcherChanged}" />
In the clientErrorCatcherBean bean you could easily write code in the change listener, which will log the errors.
Within the same application, right after the bjsf:application tag, add the following code snippet:
<e:script type="text/javascript"><![CDATA[
bb.document.addEventListener('exception', function(event) {
event.stopImmediatePropagation();
var oArgs = [event.description];
var sMessage = '';
switch(event.severity){
case 1: sMessage = 'severity: info'; break;
case 2: sMessage = 'severity: warning'; break;
case 3: sMessage = 'severity: error'; break;
}
oArgs.push(sMessage);
if(event.context && event.context.nodeType)
oArgs.push(bb.xml.serialize(event.context));
if(event.arguments)
oArgs.push(event.arguments);
/*Register the hidden input for value changes*/
bb.bjsf.registerValueChange('clientErrorListener', 'value', oArgs);
/*send message to server */
bb.bjsf.sync(bb.document.getElementById('clientErrorListener'), 'submit');
},
false
);
]]></e:script>
</f:verbatim>
Note in the snippet the (clientErrorListener) id value used in the registerValueChange and sync methods.
Like Sergey describes in his comment, you can see the usage of the exception event properties, description and severity.