yui-log.js revision ba2701ee03e94104edf19911ee0989f8cee11088
(function() {
var instance = Y;
/**
* If the 'debug' config is true, a 'yui:log' event will be
* dispatched, which the Logger widget and anything else
* can consume. If the 'useBrowserConsole' config is true, it will
* write to the browser console if available. YUI-specific log
* messages will only be present in the -debug versions of the
* JS files.
*
* @method log
* @for YUI
* @param {String} msg The message to log.
* @param {String} cat The log category for the message. Default
* categories are "info", "warn", "error", time".
* Custom categories can be used as well. (opt)
* @param {String} src The source of the the message (opt)
* @param {boolean} silent If true, the log event won't fire
* @return {YUI} YUI instance
*/
// suppress log message if the config is off or the event stack
// or the event call stack contains a consumer of the yui:log event
if (c.debug) {
// apply source filters
if (src) {
exc = c.logExclude;
inc = c.logInclude;
// console.log('checking src filter: ' + src + ', inc: ' + inc + ', exc: ' + exc);
// console.log('bail: inc list found, but src is not in list: ' + src);
bail = true;
// console.log('bail: exc list found, and src is in it: ' + src);
bail = true;
}
}
if (!bail) {
if (c.useBrowserConsole) {
if (typeof console != 'undefined') {
console[f](m);
} else if (typeof opera != 'undefined') {
}
}
}
}
}
return Y;
};
/**
* Write a system message. This message will be preserved in the
* minified and raw versions of the YUI files.
* @method log
* @for YUI
* @param {String} msg The message to log.
* @param {String} cat The log category for the message. Default
* categories are "info", "warn", "error", time".
* Custom categories can be used as well. (opt)
* @param {String} src The source of the the message (opt)
* @param {boolean} silent If true, the log event won't fire
* @return {YUI} YUI instance
*/
};
})();