@qooxdoo/framework
Version:
The JS Framework for Coders
77 lines (63 loc) • 2 kB
JavaScript
/* ************************************************************************
qooxdoo - the new era of web development
http://qooxdoo.org
Copyright:
2004-2008 1&1 Internet AG, Germany, http://www.1und1.de
License:
MIT: https://opensource.org/licenses/MIT
See the LICENSE file in the project's top-level directory for details.
Authors:
* Sebastian Werner (wpbasti)
************************************************************************ */
/**
* Processes the incoming log entry and displays it by means of the native
* logging capabilities of the client.
*
* Supported browsers:
* * Firefox <4 using FireBug (if available).
* * Firefox >=4 using the Web Console.
* * WebKit browsers using the Web Inspector/Developer Tools.
* * Internet Explorer 8+ using the F12 Developer Tools.
* * Opera >=10.60 using either the Error Console or Dragonfly
*
* Currently unsupported browsers:
* * Opera <10.60
*
* @require(qx.log.appender.Util)
* @require(qx.bom.client.Html)
*/
qx.Bootstrap.define("qx.log.appender.Native",
{
/*
*****************************************************************************
STATICS
*****************************************************************************
*/
statics :
{
/**
* Processes a single log entry
*
* @param entry {Map} The entry to process
*/
process : function(entry)
{
if (qx.core.Environment.get("html.console")) {
// Firefox 4's Web Console doesn't support "debug"
var level = console[entry.level] ? entry.level : "log";
if (console[level]) {
var args = qx.log.appender.Util.toText(entry);
console[level](args);
}
}
}
},
/*
*****************************************************************************
DEFER
*****************************************************************************
*/
defer : function(statics) {
qx.log.Logger.register(statics);
}
});