API Docs for: 3.18.1

Plugin.ConsoleFilters Class

Provides Plugin.ConsoleFilters plugin class.

This plugin adds the ability to control which Console entries display by filtering on category and source. Two groups of checkboxes are added to the Console footer, one for categories and the other for sources. Only those messages that match a checked category or source are displayed.

Methods

hideCategory

(
  • cat
)

Hides any number of categories from the UI. Convenience method for myConsole.filter.set('category.foo', false); set('category.bar', false); and so on.

Parameters:

  • cat String multiple

    1..n categories to filter out of the UI

hideSource

(
  • src
)

Hides any number of sources from the UI. Convenience method for myConsole.filter.set('source.foo', false); set('source.bar', false); and so on.

Parameters:

  • src String multiple

    1..n sources to filter out of the UI

refreshConsole

()

Repopulates the Console with entries appropriate to the current filter settings.

showCategory

(
  • cat
)

Shows any number of categories in the UI. Convenience method for myConsole.filter.set('category.foo', true); set('category.bar', true); and so on.

Parameters:

  • cat String multiple

    1..n categories to allow to display in the UI

showSource

(
  • src
)

Shows any number of sources in the UI. Convenience method for myConsole.filter.set('source.foo', true); set('source.bar', true); and so on.

Parameters:

  • src String multiple

    1..n sources to allow to display in the UI

syncUI

()

Updates the UI to be in accordance with the current state of the plugin.

Properties

CATEGORIES_TEMPLATE

String static

Markup template used to create the container for the category filters.

FILTER_TEMPLATE

String static

Markup template used to create the category and source filter checkboxes.

NAME

String static

Plugin name.

Default: 'consoleFilters'

NS

String static

The namespace hung off the host object that this plugin will inhabit.

Default: 'filter'

SOURCES_TEMPLATE

String static

Markup template used to create the container for the source filters.

Attributes

cacheLimit

Number

Maximum number of entries to store in the message cache. Use this to limit the memory footprint in environments with heavy log usage. By default, there is no limit (Number.POSITIVE_INFINITY).

Default: Number.POSITIVE_INFINITY

Fires event cacheLimitChange

Fires when the value for the configuration attribute cacheLimit is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

category

Object

Map of entry categories to their visibility status. Update a particular category's visibility by setting the subattribute to true (visible) or false (hidden).

For example, yconsole.filter.set('category.info', false) to hide log entries with the category/logLevel of 'info'.

Similarly, yconsole.filter.get('category.warn') will return a boolean indicating whether that category is currently being included in the UI.

Unlike the YUI instance configuration's logInclude and logExclude properties, filtered entries are only hidden from the UI, but can be made visible again.

Fires event categoryChange

Fires when the value for the configuration attribute category is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

defaultVisibility

Boolean

Default visibility applied to new categories and sources.

Default: true

Fires event defaultVisibilityChange

Fires when the value for the configuration attribute defaultVisibility is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

source

Object

Map of entry sources to their visibility status. Update a particular sources's visibility by setting the subattribute to true (visible) or false (hidden).

For example, yconsole.filter.set('sources.slider', false) to hide log entries originating from Y.Slider.

Fires event sourceChange

Fires when the value for the configuration attribute source is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.