YUI Library Home

YUI Library Examples: Logger Control: Using LogWriter

Logger Control: Using LogWriter

Using LogWriter.

Example: Log messages into different categories

By default, unsourced log messages get assigned to a "global" bucket.

Example: Log messages into different categories and assign them to a source called myBucket

You can assign a source to a log message by passing it in as the third argument to YAHOO.log().

Example: Create a LogWriter to write log messages from a class named MyClass

If you plan to assign many log messages to the same source (such as from a class), it may be easier to write log messages from a LogWriter instance.

Sample Code for this Example

CSS:

Markup:

JavaScript:

Configuration for This Example

You can load the necessary JavaScript and CSS for this example from Yahoo's servers. Click here to load the YUI Dependency Configurator with all of this example's dependencies preconfigured.

Copyright © 2011 Yahoo! Inc. All rights reserved.

Privacy Policy - Terms of Service - Copyright Policy - Job Openings