Skip to content
Snippets Groups Projects
Commit 154b295e authored by Steinwender, Tamara's avatar Steinwender, Tamara
Browse files

Change provider debug output from console.log to console.debug

parent c789b4ee
Branches
No related tags found
No related merge requests found
Pipeline #16941 passed with warnings
...@@ -386,7 +386,7 @@ export class FileSource extends ScopedElementsMixin(DBPLitElement) { ...@@ -386,7 +386,7 @@ export class FileSource extends ScopedElementsMixin(DBPLitElement) {
this.nextcloudPath = this.initialFileHandlingState.path; this.nextcloudPath = this.initialFileHandlingState.path;
if (this._('#nextcloud-file-picker').webDavClient !== null) { if (this._('#nextcloud-file-picker').webDavClient !== null) {
this._('#nextcloud-file-picker').loadDirectory(this.initialFileHandlingState.path); this._('#nextcloud-file-picker').loadDirectory(this.initialFileHandlingState.path);
console.log("load default nextcloud source", this.initialFileHandlingState.target); //console.log("load default nextcloud source", this.initialFileHandlingState.target);
} }
this.firstOpen = false; this.firstOpen = false;
} }
......
...@@ -23,7 +23,7 @@ export class AdapterLitElement extends LitElement { ...@@ -23,7 +23,7 @@ export class AdapterLitElement extends LitElement {
// We need to store our own "last values" because we cannot be sure what the MutationObserver detects // We need to store our own "last values" because we cannot be sure what the MutationObserver detects
this.lastProperties = {}; this.lastProperties = {};
console.log('AdapterLitElement(' + this.tagName + ') constructor()'); console.debug('AdapterLitElement(' + this.tagName + ') constructor()');
} }
getProperty(name) { getProperty(name) {
...@@ -41,7 +41,7 @@ export class AdapterLitElement extends LitElement { ...@@ -41,7 +41,7 @@ export class AdapterLitElement extends LitElement {
setProperty(name, value) { setProperty(name, value) {
// TODO: check if lit attribute really present? // TODO: check if lit attribute really present?
if (typeof value === 'object' && value !== null) { if (typeof value === 'object' && value !== null) {
// console.log("value is object", value); // console.debug("value is object", value);
this.setPropertyByAttributeName(name, value); this.setPropertyByAttributeName(name, value);
} else { } else {
this.attributeChangedCallback(name, this.getPropertyByAttributeName(name), value); this.attributeChangedCallback(name, this.getPropertyByAttributeName(name), value);
...@@ -83,7 +83,7 @@ export class AdapterLitElement extends LitElement { ...@@ -83,7 +83,7 @@ export class AdapterLitElement extends LitElement {
this.addEventListener('dbp-subscribe', function (e) { this.addEventListener('dbp-subscribe', function (e) {
const name = e.detail.name; const name = e.detail.name;
if (that.hasProperty(name) || that.root) { if (that.hasProperty(name) || that.root) {
console.log('AdapterLitElementProvider(' + that.tagName + ') eventListener("dbp-subscribe",..) name "' + name + '" found.'); console.debug('AdapterLitElementProvider(' + that.tagName + ') eventListener("dbp-subscribe",..) name "' + name + '" found.');
that.callbackStore.push({name: name, callback: e.detail.callback, sender: e.detail.sender}); that.callbackStore.push({name: name, callback: e.detail.callback, sender: e.detail.sender});
e.detail.callback(that.getProperty(name)); e.detail.callback(that.getProperty(name));
...@@ -95,12 +95,12 @@ export class AdapterLitElement extends LitElement { ...@@ -95,12 +95,12 @@ export class AdapterLitElement extends LitElement {
const name = e.detail.name; const name = e.detail.name;
const sender = e.detail.sender; const sender = e.detail.sender;
if (that.hasProperty(name) || that.root) { if (that.hasProperty(name) || that.root) {
console.log('AdapterLitElementProvider(' + that.tagName + ') eventListener("dbp-unsubscribe",..) name "' + name + '" found.'); console.debug('AdapterLitElementProvider(' + that.tagName + ') eventListener("dbp-unsubscribe",..) name "' + name + '" found.');
that.callbackStore.forEach(item => { that.callbackStore.forEach(item => {
if (item.sender === sender && item.name === name) { if (item.sender === sender && item.name === name) {
const index = that.callbackStore.indexOf(item); const index = that.callbackStore.indexOf(item);
that.callbackStore.splice(index, 1); that.callbackStore.splice(index, 1);
console.log('AdapterLitElementProvider(' + that.tagName + ') eventListener for name "' + name + '" removed.'); console.debug('AdapterLitElementProvider(' + that.tagName + ') eventListener for name "' + name + '" removed.');
} }
}); });
...@@ -114,7 +114,7 @@ export class AdapterLitElement extends LitElement { ...@@ -114,7 +114,7 @@ export class AdapterLitElement extends LitElement {
const value = e.detail.value; const value = e.detail.value;
if (that.hasProperty(name) || that.root) { if (that.hasProperty(name) || that.root) {
console.log('AdapterLitElementProvider(' + that.tagName + ') eventListener("dbp-set-property",..) name "' + name + '" found.'); console.debug('AdapterLitElementProvider(' + that.tagName + ') eventListener("dbp-set-property",..) name "' + name + '" found.');
that.setProperty(name, value); that.setProperty(name, value);
that.callbackStore.forEach(item => { that.callbackStore.forEach(item => {
...@@ -139,7 +139,7 @@ export class AdapterLitElement extends LitElement { ...@@ -139,7 +139,7 @@ export class AdapterLitElement extends LitElement {
const value = that.getAttribute(name); const value = that.getAttribute(name);
if (that.hasPropertyChanged(name, value)) { if (that.hasPropertyChanged(name, value)) {
console.log('AdapterLitElementProvider (' + that.tagName + ') observed attribute "' + name + '" changed'); console.debug('AdapterLitElementProvider (' + that.tagName + ') observed attribute "' + name + '" changed');
that.setProperty(name, value); that.setProperty(name, value);
that.callbackStore.forEach(item => { that.callbackStore.forEach(item => {
...@@ -167,7 +167,7 @@ export class AdapterLitElement extends LitElement { ...@@ -167,7 +167,7 @@ export class AdapterLitElement extends LitElement {
} }
this.setProperty(attrs[i].name, attrs[i].value); this.setProperty(attrs[i].name, attrs[i].value);
console.log('AdapterLitElementProvider (' + that.tagName + ') found attribute "' + attrs[i].name + '" = "' + attrs[i].value + '"'); console.debug('AdapterLitElementProvider (' + that.tagName + ') found attribute "' + attrs[i].name + '" = "' + attrs[i].value + '"');
} }
} }
} }
...@@ -180,7 +180,7 @@ export class AdapterLitElement extends LitElement { ...@@ -180,7 +180,7 @@ export class AdapterLitElement extends LitElement {
} }
subscribeProviderFor(element) { subscribeProviderFor(element) {
console.log('AdapterLitElement(' + this.tagName + ') subscribeProviderFor( ' + element + ' )'); console.debug('AdapterLitElement(' + this.tagName + ') subscribeProviderFor( ' + element + ' )');
const pair = element.trim().split(':'); const pair = element.trim().split(':');
const local = pair[0]; const local = pair[0];
const global = pair[1] || local; const global = pair[1] || local;
...@@ -192,14 +192,14 @@ export class AdapterLitElement extends LitElement { ...@@ -192,14 +192,14 @@ export class AdapterLitElement extends LitElement {
detail: { detail: {
name: global, name: global,
callback: (value) => { callback: (value) => {
console.log('AdapterLitElement(' + that.tagName + ') sub/Callback ' + global + ' -> ' + local + ' = ' + value); console.debug('AdapterLitElement(' + that.tagName + ') sub/Callback ' + global + ' -> ' + local + ' = ' + value);
// If value is an object set it directly as property // If value is an object set it directly as property
if (typeof value === 'object' && value !== null) { if (typeof value === 'object' && value !== null) {
// console.log("value is object", value); // console.debug("value is object", value);
that.setPropertyByAttributeName(local, value); that.setPropertyByAttributeName(local, value);
} else { } else {
// console.log("local, that.getPropertyByAttributeName(local), value", local, that.getPropertyByAttributeName(local), value); // console.debug("local, that.getPropertyByAttributeName(local), value", local, that.getPropertyByAttributeName(local), value);
that.attributeChangedCallback(local, that.getPropertyByAttributeName(local), value); that.attributeChangedCallback(local, that.getPropertyByAttributeName(local), value);
// check if an attribute also exists in the tag // check if an attribute also exists in the tag
...@@ -221,7 +221,7 @@ export class AdapterLitElement extends LitElement { ...@@ -221,7 +221,7 @@ export class AdapterLitElement extends LitElement {
} }
unSubscribeProviderFor(element) { unSubscribeProviderFor(element) {
console.log('AdapterLitElement(' + this.tagName + ') unSubscribeProviderFor( ' + element + ' )'); console.debug('AdapterLitElement(' + this.tagName + ') unSubscribeProviderFor( ' + element + ' )');
const pair = element.trim().split(':'); const pair = element.trim().split(':');
const global = pair[1] || pair[0]; const global = pair[1] || pair[0];
const event = new CustomEvent('dbp-unsubscribe', const event = new CustomEvent('dbp-unsubscribe',
...@@ -246,10 +246,10 @@ export class AdapterLitElement extends LitElement { ...@@ -246,10 +246,10 @@ export class AdapterLitElement extends LitElement {
findPropertyName(attributeName) { findPropertyName(attributeName) {
let resultName = attributeName; let resultName = attributeName;
const properties = this.constructor.properties; const properties = this.constructor.properties;
// console.log("properties", properties); // console.debug("properties", properties);
for (const propertyName in properties) { for (const propertyName in properties) {
// console.log("findPropertyName", `${propertyName}: ${properties[propertyName]}`); // console.debug("findPropertyName", `${propertyName}: ${properties[propertyName]}`);
const attribute = properties[propertyName].attribute; const attribute = properties[propertyName].attribute;
if (attribute === attributeName) { if (attribute === attributeName) {
resultName = propertyName; resultName = propertyName;
...@@ -263,7 +263,7 @@ export class AdapterLitElement extends LitElement { ...@@ -263,7 +263,7 @@ export class AdapterLitElement extends LitElement {
attributeChangedCallback(name, oldValue, newValue) { attributeChangedCallback(name, oldValue, newValue) {
switch(name) { switch(name) {
case 'subscribe': case 'subscribe':
console.log('AdapterLitElement() attributeChangesCallback( ' + name + ', ' + oldValue + ', ' + newValue + ')'); console.debug('AdapterLitElement() attributeChangesCallback( ' + name + ', ' + oldValue + ', ' + newValue + ')');
if (this.subscribe && this.subscribe.length > 0) { if (this.subscribe && this.subscribe.length > 0) {
if (this.connected) { if (this.connected) {
...@@ -291,12 +291,12 @@ export class AdapterLitElement extends LitElement { ...@@ -291,12 +291,12 @@ export class AdapterLitElement extends LitElement {
if (newValue || !oldValue || !name) { if (newValue || !oldValue || !name) {
super.attributeChangedCallback(name, oldValue, newValue); super.attributeChangedCallback(name, oldValue, newValue);
// } else { // } else {
// console.log("attributeChangedCallback ignored", name, oldValue, newValue); // console.debug("attributeChangedCallback ignored", name, oldValue, newValue);
} }
} }
// console.log("this.lang", this.tagName, name, this.lang); // console.debug("this.lang", this.tagName, name, this.lang);
// console.log("this.entryPointUrl", this.tagName, name, this.entryPointUrl); // console.debug("this.entryPointUrl", this.tagName, name, this.entryPointUrl);
// console.trace(); // console.trace();
} }
...@@ -308,7 +308,7 @@ export class AdapterLitElement extends LitElement { ...@@ -308,7 +308,7 @@ export class AdapterLitElement extends LitElement {
* @returns {boolean} * @returns {boolean}
*/ */
sendSetPropertyEvent(name, value) { sendSetPropertyEvent(name, value) {
// console.log("dbp-set-property", name, value); // console.debug("dbp-set-property", name, value);
const event = new CustomEvent('dbp-set-property', { const event = new CustomEvent('dbp-set-property', {
bubbles: true, bubbles: true,
......
...@@ -11,7 +11,7 @@ export class Adapter extends HTMLElement { ...@@ -11,7 +11,7 @@ export class Adapter extends HTMLElement {
this.subscribe = ''; this.subscribe = '';
this.unsubscribe = ''; this.unsubscribe = '';
console.log('Adapter constructor()'); console.debug('Adapter constructor()');
} }
getPropertyByAttributeName(name) { getPropertyByAttributeName(name) {
...@@ -40,7 +40,7 @@ export class Adapter extends HTMLElement { ...@@ -40,7 +40,7 @@ export class Adapter extends HTMLElement {
this.attributeChangedCallback(attrs[i].name, this.getPropertyByAttributeName(attrs[i].name), attrs[i].value); this.attributeChangedCallback(attrs[i].name, this.getPropertyByAttributeName(attrs[i].name), attrs[i].value);
console.log('AdapterProvider (' + that.tagName + ') found attribute "' + attrs[i].name + '" = "' + attrs[i].value + '"'); console.debug('AdapterProvider (' + that.tagName + ') found attribute "' + attrs[i].name + '" = "' + attrs[i].value + '"');
} }
} }
} }
...@@ -51,7 +51,7 @@ export class Adapter extends HTMLElement { ...@@ -51,7 +51,7 @@ export class Adapter extends HTMLElement {
} }
subscribeProviderFor(element) { subscribeProviderFor(element) {
console.log('AdapterProvider(' + this.tagName + ') subscribeProviderFor( ' + element + ' )'); console.debug('AdapterProvider(' + this.tagName + ') subscribeProviderFor( ' + element + ' )');
const pair = element.trim().split(':'); const pair = element.trim().split(':');
const local = pair[0]; const local = pair[0];
const global = pair[1] || local; const global = pair[1] || local;
...@@ -63,15 +63,15 @@ export class Adapter extends HTMLElement { ...@@ -63,15 +63,15 @@ export class Adapter extends HTMLElement {
detail: { detail: {
name: global, name: global,
callback: (value) => { callback: (value) => {
console.log('AdapterProvider(' + that.tagName + ') sub/Callback ' + global + ' -> ' + local + ' = ' + value); console.debug('AdapterProvider(' + that.tagName + ') sub/Callback ' + global + ' -> ' + local + ' = ' + value);
that.setPropertiesToChildNodes(local, value); that.setPropertiesToChildNodes(local, value);
// If value is an object set it directly as property // If value is an object set it directly as property
if (typeof value === 'object' && value !== null) { if (typeof value === 'object' && value !== null) {
// console.log("value is object", value); // console.debug("value is object", value);
that.setPropertyByAttributeName(local, value); that.setPropertyByAttributeName(local, value);
} else { } else {
// console.log("local, that.getPropertyByAttributeName(local), value", local, that.getPropertyByAttributeName(local), value); // console.debug("local, that.getPropertyByAttributeName(local), value", local, that.getPropertyByAttributeName(local), value);
that.attributeChangedCallback(local, that.getPropertyByAttributeName(local), value); that.attributeChangedCallback(local, that.getPropertyByAttributeName(local), value);
// check if an attribute also exists in the tag // check if an attribute also exists in the tag
...@@ -93,7 +93,7 @@ export class Adapter extends HTMLElement { ...@@ -93,7 +93,7 @@ export class Adapter extends HTMLElement {
} }
unSubscribeProviderFor(element) { unSubscribeProviderFor(element) {
console.log('AdapterProvider(' + this.tagName + ') unSubscribeProviderFor( ' + element + ' )'); console.debug('AdapterProvider(' + this.tagName + ') unSubscribeProviderFor( ' + element + ' )');
const pair = element.trim().split(':'); const pair = element.trim().split(':');
const global = pair[1] || pair[0]; const global = pair[1] || pair[0];
const event = new CustomEvent('dbp-unsubscribe', const event = new CustomEvent('dbp-unsubscribe',
...@@ -118,10 +118,10 @@ export class Adapter extends HTMLElement { ...@@ -118,10 +118,10 @@ export class Adapter extends HTMLElement {
findPropertyName(attributeName) { findPropertyName(attributeName) {
let resultName = attributeName; let resultName = attributeName;
const properties = this.constructor.properties; const properties = this.constructor.properties;
// console.log("properties", properties); // console.debug("properties", properties);
for (const propertyName in properties) { for (const propertyName in properties) {
// console.log("findPropertyName", `${propertyName}: ${properties[propertyName]}`); // console.debug("findPropertyName", `${propertyName}: ${properties[propertyName]}`);
const attribute = properties[propertyName].attribute; const attribute = properties[propertyName].attribute;
if (attribute === attributeName) { if (attribute === attributeName) {
resultName = propertyName; resultName = propertyName;
...@@ -135,7 +135,7 @@ export class Adapter extends HTMLElement { ...@@ -135,7 +135,7 @@ export class Adapter extends HTMLElement {
attributeChangedCallback(name, oldValue, newValue) { attributeChangedCallback(name, oldValue, newValue) {
switch(name) { switch(name) {
case 'subscribe': case 'subscribe':
console.log('AdapterProvider() attributeChangesCallback( ' + name + ', ' + oldValue + ', ' + newValue + ')'); console.debug('AdapterProvider() attributeChangesCallback( ' + name + ', ' + oldValue + ', ' + newValue + ')');
if (this.subscribe && this.subscribe.length > 0) { if (this.subscribe && this.subscribe.length > 0) {
if (this.connected) { if (this.connected) {
......
...@@ -42,7 +42,7 @@ class ProviderDemo extends ScopedElementsMixin(DBPLitElement) { ...@@ -42,7 +42,7 @@ class ProviderDemo extends ScopedElementsMixin(DBPLitElement) {
} }
attributeChangedCallback(name, oldValue, newValue) { attributeChangedCallback(name, oldValue, newValue) {
console.log('ProviderDemo (' + this.id + ') attributeChangesCallback( ' + name + ', ' + oldValue + ', ' + newValue + ')'); console.debug('ProviderDemo (' + this.id + ') attributeChangesCallback( ' + name + ', ' + oldValue + ', ' + newValue + ')');
switch(name) { switch(name) {
case 'lang': case 'lang':
this.lang = newValue; this.lang = newValue;
...@@ -152,13 +152,13 @@ class DemoConsumer extends DBPLitElement { ...@@ -152,13 +152,13 @@ class DemoConsumer extends DBPLitElement {
this.status = 'local'; this.status = 'local';
console.log('DemoConsumer constructor()'); console.debug('DemoConsumer constructor()');
} }
connectedCallback() { connectedCallback() {
super.connectedCallback(); super.connectedCallback();
i18n.changeLanguage(this.lang); i18n.changeLanguage(this.lang);
console.log('DemoConsumer(' + this.id + ') connectedCallback()'); console.debug('DemoConsumer(' + this.id + ') connectedCallback()');
this.render(); this.render();
} }
...@@ -180,7 +180,7 @@ class DemoConsumer extends DBPLitElement { ...@@ -180,7 +180,7 @@ class DemoConsumer extends DBPLitElement {
return; return;
} }
console.log('DemoConsumer(' + this.id + ') attributeChangesCallback( ' + name + ', ' + oldValue + ', ' + newValue + ')'); console.debug('DemoConsumer(' + this.id + ') attributeChangesCallback( ' + name + ', ' + oldValue + ', ' + newValue + ')');
switch(name) { switch(name) {
case 'lang': case 'lang':
this.lang = newValue; this.lang = newValue;
...@@ -212,7 +212,7 @@ class DemoConsumer extends DBPLitElement { ...@@ -212,7 +212,7 @@ class DemoConsumer extends DBPLitElement {
if (! this.connected) { if (! this.connected) {
return `not connected!`; return `not connected!`;
} }
console.log('DemoConsumer(' + this.id + ') render()'); console.debug('DemoConsumer(' + this.id + ') render()');
const sum = this.foo + this.bar; const sum = this.foo + this.bar;
return html` return html`
......
...@@ -12,7 +12,7 @@ export class Provider extends HTMLElement { ...@@ -12,7 +12,7 @@ export class Provider extends HTMLElement {
// We need to store our own "last values" because we cannot be sure what the MutationObserver detects // We need to store our own "last values" because we cannot be sure what the MutationObserver detects
this.lastProperties = {}; this.lastProperties = {};
console.log('Provider constructor()'); console.debug('Provider constructor()');
} }
getProperty(name) { getProperty(name) {
...@@ -33,14 +33,14 @@ export class Provider extends HTMLElement { ...@@ -33,14 +33,14 @@ export class Provider extends HTMLElement {
} }
connectedCallback() { connectedCallback() {
console.log('Provider(' + this.id + ') connectedCallback()'); console.debug('Provider(' + this.id + ') connectedCallback()');
const that = this; const that = this;
this.addEventListener('dbp-subscribe', function (e) { this.addEventListener('dbp-subscribe', function (e) {
const name = e.detail.name; const name = e.detail.name;
if (that.hasProperty(name) || that.root) { if (that.hasProperty(name) || that.root) {
console.log('Provider(' + that.id + ') eventListener("dbp-subscribe",..) name "' + name + '" found.'); console.debug('Provider(' + that.id + ') eventListener("dbp-subscribe",..) name "' + name + '" found.');
that.callbackStore.push({name: name, callback: e.detail.callback, sender: e.detail.sender}); that.callbackStore.push({name: name, callback: e.detail.callback, sender: e.detail.sender});
e.detail.callback(that.getProperty(name)); e.detail.callback(that.getProperty(name));
...@@ -52,12 +52,12 @@ export class Provider extends HTMLElement { ...@@ -52,12 +52,12 @@ export class Provider extends HTMLElement {
const name = e.detail.name; const name = e.detail.name;
const sender = e.detail.sender; const sender = e.detail.sender;
if (that.hasProperty(name) || that.root) { if (that.hasProperty(name) || that.root) {
console.log('Provider(' + that.id + ') eventListener("dbp-unsubscribe",..) name "' + name + '" found.'); console.debug('Provider(' + that.id + ') eventListener("dbp-unsubscribe",..) name "' + name + '" found.');
that.callbackStore.forEach(item => { that.callbackStore.forEach(item => {
if (item.sender === sender && item.name === name) { if (item.sender === sender && item.name === name) {
const index = that.callbackStore.indexOf(item); const index = that.callbackStore.indexOf(item);
that.callbackStore.splice(index, 1); that.callbackStore.splice(index, 1);
console.log('Provider(' + that.id + ') eventListener for name "' + name + '" removed.'); console.debug('Provider(' + that.id + ') eventListener for name "' + name + '" removed.');
} }
}); });
...@@ -71,7 +71,7 @@ export class Provider extends HTMLElement { ...@@ -71,7 +71,7 @@ export class Provider extends HTMLElement {
const value = e.detail.value; const value = e.detail.value;
if (that.hasProperty(name) || that.root) { if (that.hasProperty(name) || that.root) {
console.log('Provider(' + that.id + ') eventListener("dbp-set-property",..) name "' + name + '" found.'); console.debug('Provider(' + that.id + ') eventListener("dbp-set-property",..) name "' + name + '" found.');
that.setProperty(name, value); that.setProperty(name, value);
that.callbackStore.forEach(item => { that.callbackStore.forEach(item => {
...@@ -96,7 +96,7 @@ export class Provider extends HTMLElement { ...@@ -96,7 +96,7 @@ export class Provider extends HTMLElement {
const value = that.getAttribute(name); const value = that.getAttribute(name);
if (that.hasPropertyChanged(name, value)) { if (that.hasPropertyChanged(name, value)) {
console.log('Provider (' + that.id + ') observed attribute "' + name + '" changed'); console.debug('Provider (' + that.id + ') observed attribute "' + name + '" changed');
that.setProperty(name, value); that.setProperty(name, value);
that.callbackStore.forEach(item => { that.callbackStore.forEach(item => {
...@@ -124,7 +124,7 @@ export class Provider extends HTMLElement { ...@@ -124,7 +124,7 @@ export class Provider extends HTMLElement {
} }
this.setProperty(attrs[i].name, attrs[i].value); this.setProperty(attrs[i].name, attrs[i].value);
console.log('Provider (' + that.id + ') found attribute "' + attrs[i].name + '" = "' + attrs[i].value + '"'); console.debug('Provider (' + that.id + ') found attribute "' + attrs[i].name + '" = "' + attrs[i].value + '"');
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment