Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #557 from peuter/logging
enable/disable console logs via url parameter
- Loading branch information
Showing
4 changed files
with
93 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* ************************************************************************ | ||
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. Can be disable during runtime | ||
* | ||
* @require(qx.log.appender.Util) | ||
* @require(qx.bom.client.Html) | ||
*/ | ||
qx.Bootstrap.define("cv.log.appender.Native", | ||
{ | ||
/* | ||
***************************************************************************** | ||
STATICS | ||
***************************************************************************** | ||
*/ | ||
|
||
statics : | ||
{ | ||
/** | ||
* Processes a single log entry | ||
* | ||
* @param entry {Map} The entry to process | ||
*/ | ||
process : function(entry) | ||
{ | ||
if (cv.Config.enableLogging) { | ||
// 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); | ||
} | ||
}); |