YUI Library Examples: Logger Control: Basic Logging

Logger Control: Basic Logging

A demonstration of basic logging functionality using Logger and LogReader.

Sample Code for this Example

CSS:

1/* No custom CSS. */ 
view plain | print | ?

Markup:

1<p><a href="#" id="loglink">Click here</a> to log a simple message.</p> 
view plain | print | ?

JavaScript:

1YAHOO.example.Basic = new function() { 
2    YAHOO.util.Event.addListener(YAHOO.util.Dom.get("loglink"), "click"function(e) { 
3        YAHOO.util.Event.stopEvent(e); 
4        YAHOO.log("This is a simple log message."); 
5    }); 
6 
7    // Put a LogReader on your page 
8    this.myLogReader = new YAHOO.widget.LogReader(); 
9}; 
view plain | print | ?

Copyright © 2008 Yahoo! Inc. All rights reserved.

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