Improved logging.

This commit is contained in:
Martin Edenhofer 2015-12-29 14:21:04 +01:00
parent 187e8f10d9
commit 6960e42f9d
3 changed files with 17 additions and 0 deletions

View file

@ -121,23 +121,29 @@
if (_this.options.mode === 'textonly') {
if (!_this.options.multiline) {
text = App.Utils.htmlRemoveTags(text)
_this.log('htmlRemoveTags', text)
}
else {
_this.log('htmlRemoveRichtext', text)
text = App.Utils.htmlRemoveRichtext(text)
}
}
else {
_this.log('htmlCleanup', text)
text = App.Utils.htmlCleanup(text)
}
text = text.html()
_this.log('text.html()', text)
// as fallback, take text
if (!text) {
text = App.Utils.text2html(text.text())
_this.log('text2html', text)
}
}
else {
text = App.Utils.text2html(text)
_this.log('text2html', text)
}
// cleanup
@ -250,6 +256,9 @@
// log method
Plugin.prototype.log = function() {
if (App && App.Log) {
App.Log.debug('contenteditable', arguments)
}
if (this.options.debug) {
console.log(this._name, arguments)
}

View file

@ -143,6 +143,11 @@ var qq = function(element) {
};
qq.log = function(message, level) {
// -start- add logger
if (App && App.Log) {
App.Log.debug(this._name, arguments)
}
// -end- add logger
if (window.console) {
if (!level || level === 'info') {
window.console.log(message);

View file

@ -377,6 +377,9 @@
// log method
Plugin.prototype.log = function() {
if (App && App.Log) {
App.Log.debug(this._name, arguments)
}
if (this.options.debug) {
console.log(this._name, arguments)
}