Development JavaScript DHTML




Logger Widget :: Reading Logs







.yui-log .mytype {background-color:#FF99CC;}




    
        

Logger Widget :: Reading Logs


    

    
        
        
        
            
                
                    

Default LogReader Example


                    

With just a few lines of code, you can put a LogReader on any web
                    page that displays log messages built into the YUI Library or custom
                    log messages that you can insert into your own code. This example takes
                    advantage of the YUI Library's Drag and Drop utility to make the
                    LogReader draggable.


                    


                        Log


                    


                        Log


                    


                        Log


                    


                        Log


                    


                        Log (not supported in Opera, Safari)


                    


                        
                        Log


                    

Hide All LogReaders ||
                    Show All LogReaders


                    

Enable Output to console.log() ||
                    Disable Output to console.log()


                    

Reset Logger stack


                

            

            
                
                
                    

Sample Code


                    
                    
                    
                    /* A style was defined for a custom category.
                    By convention, it is defined with narrow-scope
                    selectors to achieve namespacing*/
                    .yui-log .mytype {background-color:#FF99CC;}
                    
                    
                    
                    
                    
                    myLogReader1 = new YAHOO.widget.LogReader();
                    myLogReader2 = new YAHOO.widget.LogReader();
                    myLogReader2.newestOnTop = false;
                    myLogReader2.setTitle("Logger Console: Oldest > on > Top!");
                    
                    
                    
                
                
            
        
        
        
    









YAHOO.example.LogReader = function() {
    var myLogReader1;
    var myLogReader2;
    
    return {
        init: function() {
            myLogReader1 = new YAHOO.widget.LogReader(null, {verboseOutput:false});
            myLogReader1.setTitle("Compact Output!");
            myLogReader2 = new YAHOO.widget.LogReader(null, {newestOnTop:false});
            myLogReader2.setTitle("Logger Console: Oldest > on > Top!");
        },
        hideAllReaders: function() {
            myLogReader1.hide();
            myLogReader2.hide();
        },
        showAllReaders: function() {
            myLogReader1.show();
            myLogReader2.show();
        }
    };
}();
YAHOO.util.Event.addListener(this,'load',YAHOO.example.LogReader.init);



dp.SyntaxHighlighter.HighlightAll('code');



           
       
yui.zip( 3,714 k)