]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/javascript/yui3/build/yui/yui-log.js
Release 6.2.0beta4
[Github/sugarcrm.git] / include / javascript / yui3 / build / yui / yui-log.js
1 /*
2  Copyright (c) 2009, Yahoo! Inc. All rights reserved.
3  Code licensed under the BSD License:
4  http://developer.yahoo.net/yui/license.txt
5  version: 3.0.0
6  build: 1549
7  */
8 YUI.add('yui-log',function(Y){(function(){var INSTANCE=Y,LOGEVENT='yui:log',UNDEFINED='undefined',LEVELS={debug:1,info:1,warn:1,error:1},_published;INSTANCE.log=function(msg,cat,src,silent){var Y=INSTANCE,c=Y.config,bail=false,excl,incl,m,f;if(c.debug){if(src){excl=c.logExclude;incl=c.logInclude;if(incl&&!(src in incl)){bail=1;}else if(excl&&(src in excl)){bail=1;}}
9 if(!bail){if(c.useBrowserConsole){m=(src)?src+': '+msg:msg;if(typeof console!=UNDEFINED&&console.log){f=(cat&&console[cat]&&(cat in LEVELS))?cat:'log';console[f](m);}else if(typeof opera!=UNDEFINED){opera.postError(m);}}
10 if(Y.fire&&!silent){if(!_published){Y.publish(LOGEVENT,{broadcast:2,emitFacade:1});_published=1;}
11 Y.fire(LOGEVENT,{msg:msg,cat:cat,src:src});}}}
12 return Y;};INSTANCE.message=function(){return INSTANCE.log.apply(INSTANCE,arguments);};})();},'3.0.0',{requires:['yui-base']});