From 11d226db2a26b3f2d1f398f0b7532afc28502e1f Mon Sep 17 00:00:00 2001
From: Richard Alam <ritzalam@gmail.com>
Date: Fri, 19 Jan 2018 13:07:48 -0800
Subject: [PATCH]  - clean up logging

---
 .../core/services/BandwidthMonitor.as            |  4 ++--
 .../src/org/bigbluebutton/main/model/PortTest.as | 16 ++++++++--------
 .../main/model/users/NetConnectionDelegate.as    |  6 +++---
 .../modules/phone/managers/ConnectionManager.as  |  8 ++------
 .../screenshare/services/red5/Connection.as      |  4 ++--
 .../components/WebRTCDesktopPublishWindow.mxml   |  2 +-
 .../view/components/WebRTCDesktopViewWindow.mxml | 11 ++++-------
 .../modules/videoconf/business/VideoProxy.as     |  6 ++----
 .../flash/bwcheck/app/BandwidthDetectionApp.as   |  5 +++--
 9 files changed, 27 insertions(+), 35 deletions(-)

diff --git a/bigbluebutton-client/src/org/bigbluebutton/core/services/BandwidthMonitor.as b/bigbluebutton-client/src/org/bigbluebutton/core/services/BandwidthMonitor.as
index 5038b47714..68863b9afc 100755
--- a/bigbluebutton-client/src/org/bigbluebutton/core/services/BandwidthMonitor.as
+++ b/bigbluebutton-client/src/org/bigbluebutton/core/services/BandwidthMonitor.as
@@ -109,7 +109,7 @@ package org.bigbluebutton.core.services
 						
 						
 						bwMonUrl = tunnelProtocol + "://" + result.server + "/" + bwMonOption.application;
-						trace("******* BW MON CONNECT tunnel = TRUE " + "url=" +  bwMonUrl);
+						LOGGER.debug("BW MON CONNECT tunnel = TRUE " + "url=" +  bwMonUrl);
 					} else {
 						var nativeProtocol: String = ConnUtil.RTMP;
 						if (useRTMPS) {
@@ -118,7 +118,7 @@ package org.bigbluebutton.core.services
 						}
 						
 						bwMonUrl = nativeProtocol + "://" + result.server + "/" + bwMonOption.application;
-						trace("******* BBB MON CONNECT tunnel = FALSE " + "url=" +  bwMonUrl);
+						LOGGER.debug("BBB MON CONNECT tunnel = FALSE " + "url=" +  bwMonUrl);
 					}
 					
             _nc.connect(bwMonUrl);
diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/PortTest.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/PortTest.as
index d37d64910a..42958e4116 100755
--- a/bigbluebutton-client/src/org/bigbluebutton/main/model/PortTest.as
+++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/PortTest.as
@@ -138,14 +138,14 @@ package org.bigbluebutton.main.model
 		public function connect():void {
 			nc = new NetConnection();
 			nc.client = this;
-			trace("******** Connecting PORT TEST hostname= " + this.hostname);
+			LOGGER.debug("Connecting PORT TEST hostname= " + this.hostname);
 			var pattern:RegExp = /(?P<protocol>.+):\/\/(?P<server>.+)/;
 			var result:Array = pattern.exec(this.hostname);
 			var useRTMPS: Boolean = result.protocol == ConnUtil.RTMPS;
 			
 			// Construct URI.
 			if (tunnel) {
-				trace("******** Connecting PORT TEST tunnel= " + tunnel);
+				LOGGER.debug("Connecting PORT TEST tunnel= " + tunnel);
 				var tunnelProtocol: String = ConnUtil.RTMPT;
 				if (useRTMPS) {
 					tunnelProtocol = ConnUtil.RTMPS;
@@ -154,7 +154,7 @@ package org.bigbluebutton.main.model
 				this.baseURI = tunnelProtocol + "://" + result.server + "/" + this.application;
 				
 			} else {
-				trace("******** Connecting PORT TEST tunnel= " + tunnel);
+				LOGGER.debug("Connecting PORT TEST tunnel= " + tunnel);
 				var nativeProtocol: String = ConnUtil.RTMP;
 				if (useRTMPS) {
 					nativeProtocol = ConnUtil.RTMPS;
@@ -180,7 +180,7 @@ package org.bigbluebutton.main.model
         
         var curTime:Number = new Date().getTime();
 				
-				trace("******** Connecting PORT TEST = " + this.baseURI);
+				LOGGER.debug("Connecting PORT TEST = " + this.baseURI);
 				// Create connection with the server.
 				nc.connect( this.baseURI, "portTestMeetingId-" + curTime, 
           "portTestDummyUserId-" + curTime, "portTestDummyToken-" + curTime);
@@ -200,7 +200,7 @@ package org.bigbluebutton.main.model
             logData.tags = ["initialization", "port-test", "connection"];
             logData.message = "Port testing connection timedout.";
             LOGGER.info(JSON.stringify(logData));
-						trace("******** Connect FAILED PORT TEST = " + this.baseURI);
+						LOGGER.debug("Connect FAILED PORT TEST = " + this.baseURI);
 			status = "FAILED";
 			_connectionListener(status, tunnel, hostname, port, application);
             closeConnection();
@@ -257,13 +257,13 @@ package org.bigbluebutton.main.model
         logData.connection = this.baseURI;
         logData.tags = ["initialization", "port-test", "connection"];
 
-				trace("******** Connect SUCCESS PORT TEST connected= " + nc.connected);
+				LOGGER.debug("Connect SUCCESS PORT TEST connected= " + nc.connected);
 				
         if ( statusCode == "NetConnection.Connect.Success" ) {
             status = "SUCCESS";
             logData.message = "Port test successfully connected.";
             LOGGER.info(JSON.stringify(logData));
-						trace("******** Connect SUCCESS PORT TEST = " + this.baseURI);
+						LOGGER.debug("Connect SUCCESS PORT TEST = " + this.baseURI);
             _connectionListener(status, tunnel, hostname, port, application);
         } else if ( statusCode == "NetConnection.Connect.Rejected" ||
                     statusCode == "NetConnection.Connect.Failed" || 
@@ -271,7 +271,7 @@ package org.bigbluebutton.main.model
             logData.statusCode = statusCode;            
             logData.message = "Port test failed to connect.";
             LOGGER.info(JSON.stringify(logData));
-						trace("******** Connect FAILED (2) PORT TEST = " + this.baseURI);
+						LOGGER.debug("Connect FAILED (2) PORT TEST = " + this.baseURI);
             status = "FAILED";
             _connectionListener(status, tunnel, hostname, port, application);
             
diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/NetConnectionDelegate.as b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/NetConnectionDelegate.as
index 6ab4097d45..c168da9218 100755
--- a/bigbluebutton-client/src/org/bigbluebutton/main/model/users/NetConnectionDelegate.as
+++ b/bigbluebutton-client/src/org/bigbluebutton/main/model/users/NetConnectionDelegate.as
@@ -223,7 +223,7 @@ package org.bigbluebutton.main.model.users
 
             var message: ValidateAuthTokenReqMsg = new ValidateAuthTokenReqMsg(body);
 
-            LOGGER.debug("******* msg \n" + JSON.stringify(message));
+            LOGGER.debug("msg \n" + JSON.stringify(message));
 
             sendMessage2x(
                 // result - On successful result
@@ -425,7 +425,7 @@ package org.bigbluebutton.main.model.users
 									
 
 									bbbAppsUrl = tunnelProtocol + "://" + result.server + "/" + result.app + "/" + intMeetingId;
-										trace("******* BBB APPS CONNECT tunnel = TRUE " + "url=" +  bbbAppsUrl);
+									LOGGER.debug("******* BBB APPS CONNECT tunnel = TRUE " + "url=" +  bbbAppsUrl);
 								} else {
 									var nativeProtocol: String = ConnUtil.RTMP;
 									if (useRTMPS) {
@@ -434,7 +434,7 @@ package org.bigbluebutton.main.model.users
 									}
 
 									bbbAppsUrl = nativeProtocol + "://" + result.server + "/" + result.app + "/" + intMeetingId;
-									trace("******* BBB APPS CONNECT tunnel = FALSE " + "url=" +  bbbAppsUrl);
+									LOGGER.debug("******* BBB APPS CONNECT tunnel = FALSE " + "url=" +  bbbAppsUrl);
                 }
 
                 var logData:Object = UsersUtil.initLogData();
diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as
index b66cd5b066..fd0af425cd 100755
--- a/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as
+++ b/bigbluebutton-client/src/org/bigbluebutton/modules/phone/managers/ConnectionManager.as
@@ -19,14 +19,12 @@
 
 package org.bigbluebutton.modules.phone.managers {	
 	import com.asfusion.mate.events.Dispatcher;
-	
 	import flash.events.AsyncErrorEvent;
 	import flash.events.NetStatusEvent;
 	import flash.events.SecurityErrorEvent;
 	import flash.net.NetConnection;
 	import flash.net.NetStream;
 	import flash.net.ObjectEncoding;
-	
 	import org.as3commons.logging.api.ILogger;
 	import org.as3commons.logging.api.getClassLogger;
 	import org.bigbluebutton.core.BBB;
@@ -103,7 +101,7 @@ package org.bigbluebutton.modules.phone.managers {
 					}
 						
 					uri = tunnelProtocol + "://" + result.server + "/" + result.app;
-					trace("******* BBB SIP CONNECT tunnel = TRUE " + "url=" +  uri);
+					LOGGER.debug("BBB SIP CONNECT tunnel = TRUE " + "url=" +  uri);
 				} else {
 					var nativeProtocol: String = ConnUtil.RTMP;
 					if (useRTMPS) {
@@ -112,11 +110,9 @@ package org.bigbluebutton.modules.phone.managers {
 					}
 					
 					uri = nativeProtocol + "://" + result.server + "/" + result.app;
-					trace("******* BBB SIP CONNECT tunnel = FALSE " + "url=" +  uri);
+					LOGGER.debug("BBB SIP CONNECT tunnel = FALSE " + "url=" +  uri);
 				}
 				
-				LOGGER.debug("******** VOICE CONF == Connecting to uri=[{0}]", [uri]);
-				
 				netConnection.objectEncoding = ObjectEncoding.AMF3;
 				netConnection.client = this;
 				netConnection.addEventListener( NetStatusEvent.NET_STATUS , netStatus );
diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/services/red5/Connection.as b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/services/red5/Connection.as
index 427b0d7f4c..912a728917 100755
--- a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/services/red5/Connection.as
+++ b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/services/red5/Connection.as
@@ -74,7 +74,7 @@ package org.bigbluebutton.modules.screenshare.services.red5 {
 							
 							
 							ssAppUrl = tunnelProtocol + "://" + result.server + "/" + result.app + "/" + UsersUtil.getInternalMeetingID();
-							trace("******* SCREENSHARE CONNECT tunnel = TRUE " + "url=" +  ssAppUrl);
+							LOGGER.debug("SCREENSHARE CONNECT tunnel = TRUE " + "url=" +  ssAppUrl);
 						} else {
 							var nativeProtocol: String = ConnUtil.RTMP;
 							if (useRTMPS) {
@@ -83,7 +83,7 @@ package org.bigbluebutton.modules.screenshare.services.red5 {
 							}
 							
 							ssAppUrl = nativeProtocol + "://" + result.server + "/" + result.app + "/" + UsersUtil.getInternalMeetingID();
-							trace("******* SCREENSHARE CONNECT tunnel = FALSE " + "url=" +  ssAppUrl);
+							LOGGER.debug("SCREENSHARE CONNECT tunnel = FALSE " + "url=" +  ssAppUrl);
 						}
 						
             netConnection.client = this;
diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/WebRTCDesktopPublishWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/WebRTCDesktopPublishWindow.mxml
index 7029a1a04b..b433c367a8 100755
--- a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/WebRTCDesktopPublishWindow.mxml
+++ b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/WebRTCDesktopPublishWindow.mxml
@@ -285,7 +285,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
 						break;
 
 					case "NetConnection.Connect.NetworkChange":
-						trace("Detected network change. User might be on a wireless and " +
+						LOGGER.info("Detected network change. User might be on a wireless and " +
 							"temporarily dropped connection. Doing nothing. Just making a note.");
 						break;
 				}
diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/WebRTCDesktopViewWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/WebRTCDesktopViewWindow.mxml
index 759c811bfb..c60d8289a1 100755
--- a/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/WebRTCDesktopViewWindow.mxml
+++ b/bigbluebutton-client/src/org/bigbluebutton/modules/screenshare/view/components/WebRTCDesktopViewWindow.mxml
@@ -40,16 +40,13 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
 	<fx:Script>
 		<![CDATA[
 			import mx.core.UIComponent;
-			
 			import flexlib.mdi.events.MDIWindowEvent;
-			
 			import org.as3commons.logging.api.ILogger;
 			import org.as3commons.logging.api.getClassLogger;
 			import org.bigbluebutton.common.IBbbModuleWindow;
 			import org.bigbluebutton.common.events.LocaleChangeEvent;
 			import org.bigbluebutton.core.BBB;
 			import org.bigbluebutton.core.Options;
-			import org.bigbluebutton.core.UsersUtil;
 			import org.bigbluebutton.main.views.MainCanvas;
 			import org.bigbluebutton.modules.screenshare.events.ViewStreamEvent;
 			import org.bigbluebutton.modules.screenshare.events.ViewWindowEvent;
@@ -150,7 +147,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
 					
 					
 					ssAppUrl = tunnelProtocol + "://" + result.serverAndApp;
-					trace("******* WEBRTC SSHARE CONNECT tunnel = TRUE " + "url=" +  ssAppUrl);
+					LOGGER.debug("WEBRTC SSHARE CONNECT tunnel = TRUE " + "url=" +  ssAppUrl);
 				} else {
 					var nativeProtocol: String = ConnUtil.RTMP;
 					if (useRTMPS) {
@@ -159,7 +156,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
 					}
 					
 					ssAppUrl = nativeProtocol + "://" + result.serverAndApp;
-					trace("******* WEBRTC SSHARE CONNECT tunnel = FALSE " + "url=" +  ssAppUrl);
+					LOGGER.debug("WEBRTC SSHARE CONNECT tunnel = FALSE " + "url=" +  ssAppUrl);
 				}
 
 				nc.objectEncoding = ObjectEncoding.AMF3;
@@ -211,7 +208,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
 						break;
 
 					case "NetConnection.Connect.Closed":
-						trace(LOG + "Deskshare connection closed.");
+						LOGGER.debug(LOG + "Deskshare connection closed.");
 						ce.status = WebRTCConnectionEvent.CLOSED;
 						break;
 
@@ -224,7 +221,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
 						break;
 
 					case "NetConnection.Connect.NetworkChange":
-						trace(LOG + "Detected network change. User might be on a wireless and temporarily dropped connection. Doing nothing. Just making a note.");
+						LOGGER.debug(LOG + "Detected network change. User might be on a wireless and temporarily dropped connection. Doing nothing. Just making a note.");
 						break;
 				}
 			}
diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/business/VideoProxy.as b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/business/VideoProxy.as
index 32564b27f6..f8a6734ffb 100755
--- a/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/business/VideoProxy.as
+++ b/bigbluebutton-client/src/org/bigbluebutton/modules/videoconf/business/VideoProxy.as
@@ -19,7 +19,6 @@
 package org.bigbluebutton.modules.videoconf.business
 {
 	import com.asfusion.mate.events.Dispatcher;
-	
 	import flash.events.AsyncErrorEvent;
 	import flash.events.IOErrorEvent;
 	import flash.events.NetStatusEvent;
@@ -30,7 +29,6 @@ package org.bigbluebutton.modules.videoconf.business
 	import flash.net.NetConnection;
 	import flash.net.NetStream;
 	import flash.net.ObjectEncoding;
-	
 	import org.as3commons.logging.api.ILogger;
 	import org.as3commons.logging.api.getClassLogger;
 	import org.bigbluebutton.core.BBB;
@@ -97,7 +95,7 @@ package org.bigbluebutton.modules.videoconf.business
 					
 					
 					vidoeConnUrl = tunnelProtocol + "://" + result.server + "/" + result.app;
-					trace("******* VIDEO CONNECT tunnel = TRUE " + "url=" +  vidoeConnUrl);
+					LOGGER.debug("VIDEO CONNECT tunnel = TRUE " + "url=" +  vidoeConnUrl);
 				} else {
 					var nativeProtocol: String = ConnUtil.RTMP;
 					if (useRTMPS) {
@@ -106,7 +104,7 @@ package org.bigbluebutton.modules.videoconf.business
 					}
 					
 					vidoeConnUrl = nativeProtocol + "://" + result.server + "/" + result.app;
-					trace("******* VIDEO CONNECT tunnel = FALSE " + "url=" +  vidoeConnUrl);
+					LOGGER.debug("VIDEO CONNECT tunnel = FALSE " + "url=" +  vidoeConnUrl);
 				}
 				
 				
diff --git a/bigbluebutton-client/src/org/red5/flash/bwcheck/app/BandwidthDetectionApp.as b/bigbluebutton-client/src/org/red5/flash/bwcheck/app/BandwidthDetectionApp.as
index d18d270927..f95b94e62e 100755
--- a/bigbluebutton-client/src/org/red5/flash/bwcheck/app/BandwidthDetectionApp.as
+++ b/bigbluebutton-client/src/org/red5/flash/bwcheck/app/BandwidthDetectionApp.as
@@ -17,6 +17,7 @@ package org.red5.flash.bwcheck.app
 	
 	public class BandwidthDetectionApp extends Application
 	{
+
 		private var _serverURL:String = "localhost";
 		private var _serverApplication:String = "";
 		private var _clientServerService:String = "";
@@ -70,7 +71,7 @@ package org.red5.flash.bwcheck.app
 				}
 				
 				bwMonUrl = tunnelProtocol + "://" + result.server + "/" + bwMonOption.application;
-				trace("******* BW MON CONNECT tunnel = TRUE " + "url=" +  bwMonUrl);
+				LogUtil.debug("BWMON CONNECT tunnel = TRUE " + "url=" +  bwMonUrl);
 			} else {
 				var nativeProtocol: String = ConnUtil.RTMP;
 				if (useRTMPS) {
@@ -79,7 +80,7 @@ package org.red5.flash.bwcheck.app
 				}
 				
 				bwMonUrl = nativeProtocol + "://" + result.server + "/" + bwMonOption.application;
-				trace("******* BBB MON CONNECT tunnel = FALSE " + "url=" +  bwMonUrl);
+				LogUtil.debug("BBB MON CONNECT tunnel = FALSE " + "url=" +  bwMonUrl);
 			}
 
 			nc.objectEncoding = flash.net.ObjectEncoding.AMF3;
-- 
GitLab