1. Benoît Bar
  2. jscop

Commits

Benoît Bar  committed e162bf7

refacto

  • Participants
  • Parent commits 9b33c85
  • Branches develop

Comments (0)

Files changed (1)

File src/jscop/core/logger.js

View file
  • Ignore whitespace
 /*
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
- * 
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
- * the specific language governing rights and limitations under the License.
- * 
- * The Original Code is Jscop javascript library.
- * 
- * The Initial Developer of the Original Code is Benoit Bar
- * <benoit.bar@scopart.fr>. Portions created by Initial Developer are Copyright
- * (C) 2011 the Initail Developer. All Rights Reserved.
- * 
- * Contributor(s): Julien Antony <julien.antony@scopart.fr> Alexis Couronne
- * <alexis.couronne@scopart.fr>
- * 
- * Alternatively, the contents of this file may be used under the terms of the
- * GNU General Public License Version 2 or later (the "GPL"), or the GNU Lesser
- * General Public License Version 2.1 or later (the "LGPL"), in which case the
- * provisions of the GPL or the LGPL are applicable instead of those above. If
- * you wish to allow use of your version of this file only under the terms of
- * either the GPL or the LGPL, and not to allow others to use your version of
- * this file under the terms of the MPL, indicate your decision by deleting the
- * provisions above and replace them with the notice and other provisions
- * required by the GPL or the LGPL. If you do not delete the provisions above, a
- * recipient may use your version of this file under the terms of any one of the
- * MPL, the GPL or the LGPL.
- */
+* The contents of this file are subject to the Mozilla Public License Version
+* 1.1 (the "License"); you may not use this file except in compliance with the
+* License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
+*
+* Software distributed under the License is distributed on an "AS IS" basis,
+* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+* the specific language governing rights and limitations under the License.
+*
+* The Original Code is Jscop javascript library.
+*
+* The Initial Developer of the Original Code is Benoit Bar
+* <benoit.bar@scopart.fr>. Portions created by Initial Developer are Copyright
+* (C) 2011 the Initail Developer. All Rights Reserved.
+*
+* Contributor(s): Julien Antony <julien.antony@scopart.fr> Alexis Couronne
+* <alexis.couronne@scopart.fr>
+*
+* Alternatively, the contents of this file may be used under the terms of the
+* GNU General Public License Version 2 or later (the "GPL"), or the GNU Lesser
+* General Public License Version 2.1 or later (the "LGPL"), in which case the
+* provisions of the GPL or the LGPL are applicable instead of those above. If
+* you wish to allow use of your version of this file only under the terms of
+* either the GPL or the LGPL, and not to allow others to use your version of
+* this file under the terms of the MPL, indicate your decision by deleting the
+* provisions above and replace them with the notice and other provisions
+* required by the GPL or the LGPL. If you do not delete the provisions above, a
+* recipient may use your version of this file under the terms of any one of the
+* MPL, the GPL or the LGPL.
+*/
 
 /**
  * @namespace Holds functionality related to logger<br />
  */
 
 /**
- * Base class for logger appender
- * 
- * @this {jscop.BaseLoggerAppender}
- * @class
- * @property {jscop.Logger} logger - The logger
- * @param {jscop.Logger}
- *            logger - Required. The logger
+ * This console appender display message in browser console
  */
-jscop.BaseLoggerAppender = function BaseLoggerAppender( logger )
+console.fatal = console.error;
+jscop.BrowserConsoleAppender = console;
+
+/**
+ * This console appender display message in HTML element
+ */
+jscop.HTMLConsoleAppender =
 {
-    this.logger = logger;
+	getContainer: function()
+	{
+		var elt = document.getElementById('jscop-logger-console');
+		if( !elt )
+		{
+			elt = document.createElement('div');
+			elt.id = 'jscop-logger-console';
+			elt.style.overflowY = 'scroll';
+			elt.style.overflowX = 'scroll';
+			elt.style.height = '80%';
+			elt.style.position = 'absolute';
+			elt.style.top = '0';
+			elt.style.right = '0';
+			elt.style.width = '40%';
+			elt.style.background = '#E9E8E8';
+			elt.style.padding = '8px';
+			var timeout = setTimeout( function()
+			{
+				elt.style.width = '0';
+			}, 700);
+			elt.onmouseover = function()
+			{
+				clearTimeout(timeout);
+				elt.style.width = '40%';
+			}
+			elt.onmouseout = function()
+			{
+				elt.style.width = '0';
+			}
+			document.body.appendChild(elt);
+		}
+		return elt;
+	},
+	debug: function(message)
+	{
+		var div = document.createElement('div');
+		div.style.border = '2px solid #AAAAAA';
+		div.style.background = '#D6D6D6';
+		div.style.color = '#424242';
+		var text = document.createTextNode(message);
+		div.appendChild(text);
+		this.getContainer().appendChild(div);
+	},
+	info: function(message)
+	{
+		var div = document.createElement('div');
+		div.style.border = '2px solid #418DD4';
+		div.style.background = '#BEDDFA';
+		div.style.color = '#00659C';
+		var text = document.createTextNode(message);
+		div.appendChild(text);
+		this.getContainer().appendChild(div);
+	},
+	warn: function(message)
+	{
+		var div = document.createElement('div');
+		div.style.border = '2px solid #FFD324';
+		div.style.background = '#FFF94A';
+		div.style.color = '#755D00';
+		var text = document.createTextNode(message);
+		div.appendChild(text);
+		this.getContainer().appendChild(div);
+	},
+	error: function(message)
+	{
+		var div = document.createElement('div');
+		div.style.border = '2px solid #FFB3B5';
+		div.style.background = '#FFD4D5';
+		div.style.color = '#8A1F11';
+		var text = document.createTextNode(message);
+		div.appendChild(text);
+		this.getContainer().appendChild(div);
+	},
+	fatal: function(message)
+	{
+		var div = document.createElement('div');
+		div.style.border = '2px solid #000000';
+		div.style.background = '#3B3B3B';
+		div.style.color = '#CCCCCC';
+		var text = document.createTextNode(message);
+		div.appendChild(text);
+		this.getContainer().appendChild(div);
+	}
 };
 
 /**
- * This logger appender display message in Firebug console
- * 
- * @class
- * @see jscop.BaseLoggerAppender
- * @augments jscop.BaseLoggerAppender
- * @param {jscop.Logger}
- *            logger - Required. The logger
- */
-jscop.FirebugLoggerAppender = function FirebugLoggerAppender( logger )
-{
-    this.constructor(logger);
-}.extend( jscop.BaseLoggerAppender );
-
-/**
- * Show a message in debug mode
- * 
- * @name debug
- * @methodOf jscop.FirebugLoggerAppender.prototype
- * @this {jscop.FirebugLoggerAppender}
- * @param {String}
- *            message - Required. The message to show
- */
-jscop.FirebugLoggerAppender.method( 'debug', function( message )
-{
-    try
-    {
-        console.debug( this.formatMessage( message, 'DEBUG' ) );
-    }
-    catch( e )
-    {}
-} );
-
-/**
- * Show a message in info mode
- * 
- * @name info
- * @methodOf jscop.FirebugLoggerAppender.prototype
- * @this {jscop.FirebugLoggerAppender}
- * @param {String}
- *            message - Required. The message to show
- */
-jscop.FirebugLoggerAppender.method( 'info', function( message )
-{
-    try
-    {
-        console.info( this.formatMessage( message, 'INFO' ) );
-    }
-    catch( e )
-    {}
-} );
-
-/**
- * Show a message in warn mode
- * 
- * @name warn
- * @methodOf jscop.FirebugLoggerAppender.prototype
- * @this {jscop.FirebugLoggerAppender}
- * @param {String}
- *            message - Required. The message to show
- */
-jscop.FirebugLoggerAppender.method( 'warn', function( message )
-{
-    try
-    {
-        console.warn( this.formatMessage( message, 'WARN' ) );
-    }
-    catch( e )
-    {}
-} );
-
-/**
- * Show a message in error mode
- * 
- * @name error
- * @methodOf jscop.FirebugLoggerAppender.prototype
- * @this {jscop.FirebugLoggerAppender}
- * @param {String}
- *            message - Required. The message to show
- */
-jscop.FirebugLoggerAppender.method( 'error', function( message )
-{
-    try
-    {
-        console.error( this.formatMessage( message, 'ERROR' ) );
-    }
-    catch( e )
-    {}
-} );
-
-/**
- * Show a message in fatal mode
- * 
- * @name fatal
- * @methodOf jscop.FirebugLoggerAppender.prototype
- * @this {jscop.FirebugLoggerAppender}
- * @param {String}
- *            message - Required. The message to show
- */
-jscop.FirebugLoggerAppender.method( 'fatal', function( message )
-{
-    try
-    {
-        console.error( this.formatMessage( message, 'FATAL' ) );
-    }
-    catch( e )
-    {}
-} );
-
-/**
- * Format a given message for given level
- * 
- * @name formatMessage
- * @methodOf jscop.FirebugLoggerAppender.prototype
- * @this {jscop.FirebugLoggerAppender}
- * @param {String}
- *            message - Required. The message to format
- * @param {number}
- *            level - Required. The level in which the message will be formatted
- * @returns {String} the message formated for level
- */
-jscop.FirebugLoggerAppender.method( 'formatMessage', function( message, level )
-{
-    var date = new Date();
-    var d = date.format( jscop.Logger.setting.dateFormat );
-    var s = jscop.Logger.setting.formating;
-    s = s.replace( '%D', d );
-    s = s.replace( '%L', level );
-    s = s.replace( '%C', this.logger.classLogged );
-    s = s.replace( '%M', message );
-    return s;
-} );
-
-/**
- * This logger appender display message in a float div element
- * 
- * @class
- * @see jscop.BaseLoggerAppender
- * @augments jscop.BaseLoggerAppender
- * @param {jscop.Logger}
- *            logger - Required. The logger
- */
-jscop.HtmlLoggerAppender = function HtmlLoggerAppender( logger )
-{
-    this.constructor(logger);
-    var self = this;
-    this.console = $( '#jscop-logger-console' );
-    this.isVisible = true;
-    this.timeout;
-    if( !this.console.get( 0 ) )
-    {
-        var consoleTaskbar = $( '<div id="jscop-logger-console-taskbar">Clear</div>' );
-        consoleTaskbar.css( 'background-color', '#F2F2F2' );
-        consoleTaskbar.css( 'text-align', 'right' );
-        consoleTaskbar.css( 'padding-right', '5px' );
-        consoleTaskbar.css( 'cursor', 'pointer' );
-        consoleTaskbar.css( 'border', '1px solid #A4A1A1' );
-        consoleTaskbar.css( 'font-size', '100%' );
-        consoleTaskbar.css( 'font-weight', 'bolder' );
-        consoleTaskbar.height( '20px' );
-        consoleTaskbar.click( function( event )
-        {
-            self.console.empty();
-        } );
-
-        this.console = $( '<div id="jscop-logger-console"></div>' );
-        this.console.css( 'overflow-y', 'scroll' );
-        this.console.css( 'height', '500px' );
-
-        var consoleContainer = $( '<div id="jscop-logger-console-container"></div>' );
-        consoleContainer.css( 'position', 'absolute' );
-        consoleContainer.css( 'top', 0 );
-        consoleContainer.css( 'right', 0 );
-        consoleContainer.css( 'padding', '2px' );
-        consoleContainer.css( 'padding-top', '0' );
-        consoleContainer.css( 'background-color', '#E9E8E8' );
-        consoleContainer.width( '40%' );
-        consoleContainer.css( 'opacity', 0.9 );
-        consoleContainer.bind( 'mouseenter', function( event )
-        {
-            if( !self.isVisible )
-            {
-                $( this ).animate( {
-                    'width' : '40%',
-                    'opacity' : 0.9
-                }, 'high', function()
-                {
-                    self.isVisible = true;
-                } );
-                consoleTaskbar.css( 'display', 'block' );
-            }
-            else
-            {
-                clearTimeout( self.timeout );
-            }
-        } );
-        consoleContainer.bind( jscop.Logger.MESSAGE_PREPEND_EVENT, function( event )
-        {
-            if( !self.isVisible )
-            {
-                $( this ).animate( {
-                    'width' : '40%',
-                    'opacity' : 0.9
-                }, 'high', function()
-                {
-                    self.isVisible = true;
-                } );
-                consoleTaskbar.css( 'display', 'block' );
-                self.timeout = setTimeout( function()
-                {
-                    consoleContainer.trigger( 'mouseleave' );
-                }, 5000 );
-            }
-            else
-            {
-                clearTimeout( self.timeout );
-                self.timeout = setTimeout( function()
-                {
-                    consoleContainer.trigger( 'mouseleave' );
-                }, 5000 );
-            }
-        } );
-        consoleContainer.bind( 'mouseleave', function( event )
-        {
-            if( self.isVisible )
-            {
-                $( this ).animate( {
-                    'width' : '0',
-                    'opacity' : 0
-                }, 'high', function()
-                {
-                    consoleTaskbar.css( 'display', 'none' );
-                    self.isVisible = false;
-                } );
-            }
-        } );
-
-        this.console.appendTo( consoleContainer );
-        consoleTaskbar.appendTo( consoleContainer );
-        consoleContainer.prependTo( document.body );
-
-        setTimeout( function()
-        {
-            consoleContainer.trigger( 'mouseleave' );
-        }, 700 );
-    }
-}.extend( jscop.BaseLoggerAppender );
-
-/**
- * Show a message in debug mode
- * 
- * @name debug
- * @methodOf jscop.HtmlLoggerAppender.prototype
- * @this {jscop.HtmlLoggerAppender}
- * @param {String}
- *            message - Required. The message to show
- */
-jscop.HtmlLoggerAppender.method( 'debug', function( message )
-{
-    var elt = this.formatMessage( message, 'DEBUG' );
-    elt.css( 'border', '2px solid #AAAAAA' );
-    elt.css( 'background-color', '#D6D6D6' );
-    elt.css( 'color', '#424242' );
-    this.console.prepend( elt );
-} );
-
-/**
- * Show a message in info mode
- * 
- * @name info
- * @methodOf jscop.HtmlLoggerAppender.prototype
- * @this {jscop.HtmlLoggerAppender}
- * @param {String}
- *            message - Required. The message to show
- */
-jscop.HtmlLoggerAppender.method( 'info', function( message )
-{
-    var elt = this.formatMessage( message, 'INFO' );
-    elt.css( 'border', '2px solid #418DD4' );
-    elt.css( 'background-color', '#BEDDFA' );
-    elt.css( 'color', '#00659C' );
-    this.console.prepend( elt );
-} );
-
-/**
- * Show a message in warn mode
- * 
- * @name warn
- * @methodOf jscop.HtmlLoggerAppender.prototype
- * @this {jscop.HtmlLoggerAppender}
- * @param {String}
- *            message - Required. The message to show
- */
-jscop.HtmlLoggerAppender.method( 'warn', function( message )
-{
-    var elt = this.formatMessage( message, 'WARN' );
-    elt.css( 'border', '2px solid #FFD324' );
-    elt.css( 'background-color', '#FFF94A' );
-    elt.css( 'color', '#755D00' );
-    this.console.prepend( elt );
-} );
-
-/**
- * Show a message in error mode
- * 
- * @name error
- * @methodOf jscop.HtmlLoggerAppender.prototype
- * @this {jscop.HtmlLoggerAppender}
- * @param {String}
- *            message - Required. The message to show
- */
-jscop.HtmlLoggerAppender.method( 'error', function( message )
-{
-    var elt = this.formatMessage( message, 'ERROR' );
-    elt.css( 'border', '2px solid #FFB3B5' );
-    elt.css( 'background-color', '#FFD4D5' );
-    elt.css( 'color', '#8A1F11' );
-    this.console.prepend( elt );
-} );
-
-/**
- * Show a message in fatal mode
- * 
- * @name fatal
- * @methodOf jscop.HtmlLoggerAppender.prototype
- * @this {jscop.HtmlLoggerAppender}
- * @param {String}
- *            message - Required. The message to show
- */
-jscop.HtmlLoggerAppender.method( 'fatal', function( message )
-{
-    var elt = this.formatMessage( message, 'FATAL' );
-    elt.css( 'border', '2px solid #000000' );
-    elt.css( 'background-color', '#3B3B3B' );
-    elt.css( 'color', '#CCCCCC' );
-    this.console.prepend( elt );
-} );
-
-/**
- * Format a given message for given level
- * 
- * @name formatMessage
- * @methodOf jscop.HtmlLoggerAppender.prototype
- * @this {jscop.FirebugLoggerAppender}
- * @param {String}
- *            message - Required. The message to format
- * @param {number}
- *            level - Required. The level in which the message will be formatted
- * @returns {String} the message formated for level
- */
-jscop.HtmlLoggerAppender.method( 'formatMessage', function( message, level )
-{
-    var date = new Date();
-    var d = date.format( jscop.Logger.setting.dateFormat );
-    var s = jscop.Logger.setting.formating;
-    s = s.replace( '%D', '<em>' + d + '</em>' );
-    s = s.replace( '%L', '<strong>' + level + '</strong>' );
-    s = s.replace( '%C', this.logger.classLogged );
-    s = s.replace( '%M', message );
-    var elt = $( '<div>&nbsp;</div>' );
-    elt.addClass( 'jscop-logger-log' );
-    elt.css( 'padding', '2px' );
-    elt.css( 'margin-top', '2px' );
-    elt.css( 'margin-right', '2px' );
-    elt.append( s );
-    this.console.trigger( jscop.Logger.MESSAGE_PREPEND_EVENT );
-    return elt;
-} );
-
-/**
  * Logger Constructor
- * 
+ *
  * @class
  * @property {String} classLogged - The class name to log
  * @property {jscop.AbstractLoggerAppender} appender - The appender for the
  * @param {jscop.AbstractLoggerAppender}
  *            appender - Required. The appender for the logger
  * @example
- * 
+ *
  * <pre>
  * //Build a logger with default settings
  * var logger = new jscop.Logger( MyClass );
- * 
+ *
  * //Log messages in html console
  * jscop.logger.settings.appender = jscop.HtmlLoggerAppender;
  * var logger = new jscop.Logger( 'MyClass' );
- * 
+ *
  * //Specified level for a class
  * jscop.logger.settings.level = {
  *     'MyClass' : jscop.Logger.DEBUG,
  */
 jscop.Logger = function Logger( classLogged, appender )
 {
-    this.classLogged = classLogged;
-    this.appender = ( null == appender ? new jscop.Logger.setting.appender( this ) : new appender( this ) );
+	this.classLogged = classLogged;
+	this.appender = ( null == appender ? jscop.Logger.setting.appender : appender );
 };
-
 /**
  * Return true if the given level can be show for this logger depending on the
  * settings
- * 
+ *
  * @name checkLevel
  * @methodOf jscop.Logger.prototype
  * @this {jscop.Logger}
  */
 jscop.Logger.method('checkLevel', function( level )
 {
-    return ( ( jscop.Logger.setting.root <= level && jscop.Logger.setting.level[ this.classLogged ] === undefined ) || jscop.Logger.setting.level[ this.classLogged ] <= level );
+	return ( ( jscop.Logger.setting.root <= level && jscop.Logger.setting.level[ this.classLogged ] === undefined ) || jscop.Logger.setting.level[ this.classLogged ] <= level );
 } );
-
 /**
  * Append a debug message if it is to be displayed
- * 
+ *
  * @name debug
  * @methodOf jscop.Logger.prototype
  * @this {jscop.Logger}
  */
 jscop.Logger.method( 'debug', function( message )
 {
-    if( this.checkLevel( jscop.Logger.DEBUG ) )
-    {
-        this.appender.debug( message );
-    }
+	if( this.checkLevel( jscop.Logger.DEBUG ) )
+	{
+		try
+		{
+			this.appender.debug( this.formatMessage( message, jscop.Logger.LEVEL_LABELS[jscop.Logger.DEBUG] ) );
+		}
+		catch( e )
+		{
+		}
+	}
 } );
-
 /**
  * Append an info message if it is to be displayed
- * 
+ *
  * @name info
  * @methodOf jscop.Logger.prototype
  * @this {jscop.Logger}
  */
 jscop.Logger.method( 'info', function( message )
 {
-    if( this.checkLevel( jscop.Logger.INFO ) )
-    {
-        this.appender.info( message );
-    }
+	if( this.checkLevel( jscop.Logger.INFO ) )
+	{
+		try
+		{
+			this.appender.info( this.formatMessage( message, jscop.Logger.LEVEL_LABELS[jscop.Logger.INFO] ) );
+		}
+		catch( e )
+		{
+		}
+	}
 } );
-
 /**
  * Append a warn message if it is to be displayed
- * 
+ *
  * @name warn
  * @methodOf jscop.Logger.prototype
  * @this {jscop.Logger}
  */
 jscop.Logger.method( 'warn', function( message )
 {
-    if( this.checkLevel( jscop.Logger.WARN ) )
-    {
-        this.appender.warn( message );
-    }
+	if( this.checkLevel( jscop.Logger.WARN ) )
+	{
+		try
+		{
+			this.appender.warn( this.formatMessage( message, jscop.Logger.LEVEL_LABELS[jscop.Logger.WARN] ) );
+		}
+		catch( e )
+		{
+		}
+	}
 } );
-
 /**
  * Append a error message if it is to be displayed
- * 
+ *
  * @name error
  * @methodOf jscop.Logger.prototype
  * @this {jscop.Logger}
  */
 jscop.Logger.method( 'error', function( message )
 {
-    if( this.checkLevel( jscop.Logger.ERROR ) )
-    {
-        this.appender.error( message );
-    }
+	if( this.checkLevel( jscop.Logger.ERROR ) )
+	{
+		try
+		{
+			this.appender.error( this.formatMessage( message, jscop.Logger.LEVEL_LABELS[jscop.Logger.ERROR] ) );
+		}
+		catch( e )
+		{
+		}
+	}
 } );
-
 /**
  * Append a fatal message if it is to be displayed
- * 
+ *
  * @name fatal
  * @methodOf jscop.Logger.prototype
  * @this {jscop.Logger}
  */
 jscop.Logger.method( 'fatal', function( message )
 {
-    if( this.checkLevel( jscop.Logger.FATAL ) )
-    {
-        this.appender.fatal( message );
-    }
+	if( this.checkLevel( jscop.Logger.FATAL ) )
+	{
+		try
+		{
+			this.appender.fatal( this.formatMessage( message, jscop.Logger.LEVEL_LABELS[jscop.Logger.FATAL] ) );
+		}
+		catch( e )
+		{
+		}
+	}
 } );
-
-/**
- * Logger event definition. Send by a jscop.HtmlLoggerAppender when a message is
- * added to the logger
- * 
- * @constant
- */
-jscop.Logger.MESSAGE_PREPEND_EVENT = 'messageprepend';
-
+jscop.Logger.method('formatMessage', function( message, level )
+{
+	var date = new Date();
+	var d = date.format( jscop.Logger.setting.dateFormat );
+	var s = jscop.Logger.setting.formating;
+	s = s.replace( '%D', d );
+	s = s.replace( '%L', level );
+	s = s.replace( '%C', this.classLogged );
+	s = s.replace( '%M', message );
+	return s;
+});
+jscop.Logger.LEVEL_LABELS = [];
 /**
  * Debug level definition
- * 
+ *
  * @constant
  */
 jscop.Logger.DEBUG = 0;
+jscop.Logger.LEVEL_LABELS[jscop.Logger.DEBUG] = 'DEBUG';
 /**
  * Info level definition
- * 
+ *
  * @constant
  */
 jscop.Logger.INFO = 1;
+jscop.Logger.LEVEL_LABELS[jscop.Logger.INFO] = 'INFO';
 /**
  * Warning level definition
- * 
+ *
  * @constant
  */
 jscop.Logger.WARN = 2;
+jscop.Logger.LEVEL_LABELS[jscop.Logger.WARN] = 'WARN';
 /**
  * Error level definition
- * 
+ *
  * @constant
  */
 jscop.Logger.ERROR = 3;
+jscop.Logger.LEVEL_LABELS[jscop.Logger.ERROR] = 'ERROR';
 /**
  * Fatal level definition
- * 
+ *
  * @constant
  */
 jscop.Logger.FATAL = 4;
+jscop.Logger.LEVEL_LABELS[jscop.Logger.FATAL] = 'FATAL';
 
 /**
  * Default settings for logger
- * 
+ *
  * <pre>
  * jscop.Logger.setting = {
  *     root : jscop.Logger.DEBUG,
- *     appender : jscop.FirebugLoggerAppender,
+ *     appender : jscop.BrowserConsoleAppender,
  *     formating : '%D %L [%C] %M',
  *     dateFormat : 'dd/mm/yyyy HH:MM:ss',
  *     level : {}
  * };
  * </pre>
- * 
+ *
  * @static
  */
-jscop.Logger.setting = {
-    root : jscop.Logger.DEBUG,
-    appender : jscop.FirebugLoggerAppender,
-    formating : '%D %L [%C] %M',
-    dateFormat : 'dd/mm/yyyy HH:MM:ss',
-    level : {}
+jscop.Logger.setting =
+{
+	root : jscop.Logger.DEBUG,
+	appender : jscop.BrowserConsoleAppender,
+	formating : '%D %L [%C] %M',
+	dateFormat : 'dd/mm/yyyy HH:MM:ss',
+	level :
+	{
+	}
 };
 
 /**
- * A root logger for firebug that already initialized
- * 
+ * A root logger for browser console that already initialized
+ *
  * @example
- * 
+ *
  * <pre>
- * firebug.debug( 'My log message' )
+ * logging.debug( 'My log message' )
  * </pre>
  */
-var firebug = new jscop.Logger( 'root', jscop.FirebugLoggerAppender );
+var logging = new jscop.Logger( 'root', jscop.BrowserConsoleAppender );