| 
				
			 | 
			
			
				
				@@ -8,6 +8,16 @@ var GlobalOnErrorHandler = require("../util/GlobalOnErrorHandler"); 
			 | 
		
		
	
		
			
			| 
				8
			 | 
			
				8
			 | 
			
			
				
				 module.exports = function () { 
			 | 
		
		
	
		
			
			| 
				9
			 | 
			
				9
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				10
			 | 
			
				10
			 | 
			
			
				
				     Strophe.log = function (level, msg) { 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				11
			 | 
			
			
				
				+        // Our global handler reports uncaught errors to the stats which may 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				12
			 | 
			
			
				
				+        // interpret those as partial call failure. 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				13
			 | 
			
			
				
				+        // Strophe log entry about secondary request timeout does not mean that 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				14
			 | 
			
			
				
				+        // it's a final failure(the request will be restarted), so we lower it's 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				15
			 | 
			
			
				
				+        // level here to a warning. 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				16
			 | 
			
			
				
				+        if (typeof msg === 'string' && 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				17
			 | 
			
			
				
				+                msg.indexOf("Request ") !== -1 && 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				18
			 | 
			
			
				
				+                msg.indexOf("timed out (secondary), restarting") !== -1) { 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				19
			 | 
			
			
				
				+            level = Strophe.LogLevel.WARN; 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				20
			 | 
			
			
				
				+        } 
			 | 
		
		
	
		
			
			| 
				11
			 | 
			
				21
			 | 
			
			
				
				         switch (level) { 
			 | 
		
		
	
		
			
			| 
				12
			 | 
			
				22
			 | 
			
			
				
				             case Strophe.LogLevel.WARN: 
			 | 
		
		
	
		
			
			| 
				13
			 | 
			
				23
			 | 
			
			
				
				                 logger.warn("Strophe: " + msg); 
			 |