aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dojox/analytics/plugins/consoleMessages.js
blob: 6b8e0f0f4a94f74dada6ac06b7b33ce59e4481fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
if(!dojo._hasResource["dojox.analytics.plugins.consoleMessages"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojox.analytics.plugins.consoleMessages"] = true;
dojo.provide("dojox.analytics.plugins.consoleMessages");

dojox.analytics.plugins.consoleMessages = new (function(){
	// summary:
	//	plugin to have analyitcs return the base info dojo collects
	this.addData = dojo.hitch(dojox.analytics, "addData", "consoleMessages");

	var lvls = dojo.config["consoleLogFuncs"] || ["error", "warn", "info", "rlog"];
	if(!console){
		console={};
	}

	for(var i=0; i<lvls.length;i++){
		if (console[lvls[i]]){
			dojo.connect(console, lvls[i], dojo.hitch(this, "addData", lvls[i]));
		}else{
			console[lvls[i]] = dojo.hitch(this, "addData", lvls[i]);	
		}
	}
})();

}