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

View file

@ -143,6 +143,11 @@ var qq = function(element) {
}; };
qq.log = function(message, level) { 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 (window.console) {
if (!level || level === 'info') { if (!level || level === 'info') {
window.console.log(message); window.console.log(message);

View file

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