YUI configuration to filter log messages

This example illustrates how to configure your YUI instance to ignore certain log messages to aid in reducing the signal-to-noise ratio when debugging.

Log messages filtered out from the YUI config are permanently ignored. If you want to be able to temporarily hide and reshow messages, use the ConsoleFilters plugin. It is not uncommon to set up logInclude or logExclude in the YUI configuration and use the ConsoleFilters plugin.

Log messages can be ignored based on the source (e.g. event or attribute) or based on their log level (info, warn, error).

Source filter

Log level

Log a message

Source: Category:

Code preview

// YUI instance configuration
var Y = YUI({
    "logLevel": "info",
    "logExclude": {
        "sourceC": true
    }
});

// Log statement
Y.log("This is a log message!", "info", "sourceA");