yui-log-debug.js revision e371fe50702011b7021c8d79181e88184c23448b
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * Provides console log capability and exposes a custom event for
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * console implementations.
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * @module yui
7e37c6180f8e3d8ce94f29fcaaaa046d2466e6a3vboxsync * @submodule yui-log
78f327ee942771169c65c91baf789fd10e72b01avboxsync(function() {
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * If the 'debug' config is true, a 'yui:log' event will be
131561c23ec73ceb3818b6df9ff32729642907dbvboxsync * dispatched, which the Console widget and anything else
e139144ef4fc5f2bbe26be64faf2737cd8ccf413vboxsync * can consume. If the 'useBrowserConsole' config is true, it will
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * write to the browser console if available. YUI-specific log
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * messages will only be present in the -debug versions of the
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * JS files. The build system is supposed to remove log statements
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * from the raw and minified versions of the files.
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * @method log
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * @param {String} msg The message to log.
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * @param {String} cat The log category for the message. Default
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * categories are "info", "warn", "error", time".
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * Custom categories can be used as well. (opt)
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * @param {String} src The source of the the message (opt)
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * @param {boolean} silent If true, the log event won't fire
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * @return {YUI} YUI instance
0912cf29d2641459d225c40114c567a63273746cvboxsync // suppress log message if the config is off or the event stack
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync // or the event call stack contains a consumer of the yui:log event
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync // apply source filters
0912cf29d2641459d225c40114c567a63273746cvboxsync } else if (typeof console != UNDEFINED && console.log) {
0912cf29d2641459d225c40114c567a63273746cvboxsync f = (cat && console[cat] && (cat in LEVELS)) ? cat : 'log';
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * Write a system message. This message will be preserved in the
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * minified and raw versions of the YUI files, unlike log statements.
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * @method message
0912cf29d2641459d225c40114c567a63273746cvboxsync * @param {String} msg The message to log.
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * @param {String} cat The log category for the message. Default
0912cf29d2641459d225c40114c567a63273746cvboxsync * categories are "info", "warn", "error", time".
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * Custom categories can be used as well. (opt)
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * @param {String} src The source of the the message (opt)
dee9e52b1688c0617890cbbd8a8488f9f315d1b7vboxsync * @param {boolean} silent If true, the log event won't fire
0912cf29d2641459d225c40114c567a63273746cvboxsync * @return {YUI} YUI instance