- allow to externally log auto-reconnects

This commit is contained in:
Richard Alam 2015-08-07 17:02:32 +00:00
parent 7a4ebcb415
commit 576d027c8d
2 changed files with 24 additions and 3 deletions

View File

@ -32,12 +32,14 @@ package org.bigbluebutton.core.managers
import org.as3commons.logging.api.ILogger; import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger; import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.main.api.JSLog;
import org.bigbluebutton.main.events.BBBEvent; import org.bigbluebutton.main.events.BBBEvent;
import org.bigbluebutton.main.events.ClientStatusEvent; import org.bigbluebutton.main.events.ClientStatusEvent;
import org.bigbluebutton.main.events.LogoutEvent; import org.bigbluebutton.main.events.LogoutEvent;
import org.bigbluebutton.main.model.users.AutoReconnect; import org.bigbluebutton.main.model.users.AutoReconnect;
import org.bigbluebutton.main.views.ReconnectionPopup; import org.bigbluebutton.main.views.ReconnectionPopup;
import org.bigbluebutton.util.i18n.ResourceUtil; import org.bigbluebutton.util.i18n.ResourceUtil;
public class ReconnectionManager public class ReconnectionManager
{ {
@ -87,8 +89,14 @@ package org.bigbluebutton.core.managers
public function onDisconnected(type:String, callback:Function, parameters:Array):void { public function onDisconnected(type:String, callback:Function, parameters:Array):void {
if (!_canceled) { if (!_canceled) {
LOGGER.warn("onDisconnected, type={0}, parameters={1}" + [type, parameters.toString()]); LOGGER.warn("onDisconnected, type={0}, parameters={1}", [type, parameters.toString()]);
var logData:Object = new Object();
logData.user = UsersUtil.getUserData();
logData.user.connection = type;
JSLog.warn("Connection disconnected", logData);
var obj:Object = new Object(); var obj:Object = new Object();
obj.callback = callback; obj.callback = callback;
obj.callbackParameters = parameters; obj.callbackParameters = parameters;
@ -106,6 +114,13 @@ package org.bigbluebutton.core.managers
public function onConnectionAttemptFailed(type:String):void { public function onConnectionAttemptFailed(type:String):void {
LOGGER.warn("onConnectionAttemptFailed, type={0}", [type]); LOGGER.warn("onConnectionAttemptFailed, type={0}", [type]);
var logData:Object = new Object();
logData.user = UsersUtil.getUserData();
logData.user.connection = type;
JSLog.warn("Reconnect attempt on connection failed.", logData);
if (_connections.hasOwnProperty(type)) { if (_connections.hasOwnProperty(type)) {
_connections[type].reconnect.onConnectionAttemptFailed(); _connections[type].reconnect.onConnectionAttemptFailed();
} }
@ -136,6 +151,12 @@ package org.bigbluebutton.core.managers
public function onConnectionAttemptSucceeded(type:String):void { public function onConnectionAttemptSucceeded(type:String):void {
LOGGER.debug("onConnectionAttemptSucceeded, type={0}", [type]); LOGGER.debug("onConnectionAttemptSucceeded, type={0}", [type]);
var logData:Object = new Object();
logData.user = UsersUtil.getUserData();
logData.user.connection = type;
JSLog.warn("Reconnect succeeded.", logData);
dispatchReconnectionSucceededEvent(type); dispatchReconnectionSucceededEvent(type);
delete _connections[type]; delete _connections[type];

View File

@ -130,7 +130,7 @@ package org.bigbluebutton.modules.users.services
LOGGER.debug(result); LOGGER.debug(result);
}, },
function(status:String):void { // status - On error occurred function(status:String):void { // status - On error occurred
LOGGER.error(status); LOGGER.error(status);
}, },
streamName streamName
); );