Skip to content

Commit 1c41a91

Browse files
authored
Clean up debugging console log messages (openhab#676)
Remove most of the debug logging in the Javascript console, or adjust the log levels. Signed-off-by: Yannick Schaus <[email protected]>
1 parent 1392a98 commit 1c41a91

21 files changed

+7
-38
lines changed

bundles/org.openhab.ui/web/src/components/config/controls/parameter-dayofweek.vue

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export default {
2929
if (!value) newValuesSet.delete(day)
3030
let newValues = new Array(...newValuesSet).sort((a, b) => this.values.indexOf(a) < this.values.indexOf(b))
3131
newValues.sort((a, b) => this.values.indexOf(a) - this.values.indexOf(b))
32-
console.log(newValues)
3332
this.$emit('input', newValues)
3433
}
3534
}

bundles/org.openhab.ui/web/src/components/config/controls/script-editor.vue

-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ export default {
308308
}
309309
},
310310
mounted () {
311-
// console.log('codemirror ready: ', this.codemirror)
312311
}
313312
}
314313
</script>

bundles/org.openhab.ui/web/src/components/expandable-card.vue

-2
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,9 @@ export default {
225225
},
226226
methods: {
227227
cardOpening () {
228-
console.log('card opened')
229228
setTimeout(() => { this.opened = true }, 200)
230229
},
231230
cardClosed () {
232-
console.log('card closed')
233231
this.opened = false
234232
}
235233
}

bundles/org.openhab.ui/web/src/components/model/link-details.vue

-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ export default {
7575
},
7676
on: {
7777
pageAfterOut (event, page) {
78-
console.log('page closed')
7978
}
8079
}
8180
}
@@ -96,7 +95,6 @@ export default {
9695
},
9796
on: {
9897
pageAfterOut (event, page) {
99-
console.log('page closed')
10098
}
10199
}
102100
}
@@ -116,7 +114,6 @@ export default {
116114
}
117115
},
118116
links () {
119-
console.log('LinkDetails: links changed')
120117
this.load()
121118
}
122119
}

bundles/org.openhab.ui/web/src/components/tags/semantics-picker.vue

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ export default {
6464
itemChanged (item) {
6565
this.show = false
6666
if (!item.tags) return
67-
// console.log(item.tags)
6867
this.semanticClass = ''
6968
this.semanticProperty = ''
7069
item.tags.forEach((t) => {

bundles/org.openhab.ui/web/src/components/thing/channel-group.vue

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export default {
6666
return ''
6767
},
6868
opened (channel) {
69-
console.log('channel opened:' + channel.id)
7069
this.$emit('channel-opened', {
7170
channelId: channel.id,
7271
channel: channel

bundles/org.openhab.ui/web/src/components/thing/channel-link.vue

-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ export default {
108108
},
109109
on: {
110110
pageAfterOut (event, page) {
111-
console.log('page closed')
112111
// const finalChannel = page.app.data.finalChannel
113112
// if (finalChannel) {
114113
// delete page.app.data.finalChannel
@@ -138,7 +137,6 @@ export default {
138137
},
139138
on: {
140139
pageAfterOut (event, page) {
141-
console.log('page closed')
142140
}
143141
}
144142
}

bundles/org.openhab.ui/web/src/components/thing/channel-list.vue

-2
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ export default {
178178
return channel.linkedItems && channel.linkedItems.length > 0
179179
},
180180
toggleItemCheck (channel, channelType) {
181-
console.log('toggle check')
182181
if (this.isChecked(channel)) {
183182
this.selectedChannels.splice(this.selectedChannels.indexOf(channel), 1)
184183
this.newItems.splice(this.newItems.findIndex((i) => i.channel === channel), 1)
@@ -220,7 +219,6 @@ export default {
220219
return this.newItems.find((i) => i.channel === channel)
221220
},
222221
channelOpened (payload) {
223-
console.log('caught channel-opened')
224222
this.openedChannelId = payload.channelId
225223
this.openedChannel = payload.channel
226224
}

bundles/org.openhab.ui/web/src/components/widgets/chart/misc/oh-chart-tooltip.js

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export default {
1010

1111
if (component.config.smartFormatter) {
1212
options.formatter = (params, ticket, callback) => {
13-
// console.log(params)
1413
let tooltip = ''
1514
if (params.componentType === 'markArea') {
1615
tooltip += `<div>${dayjs(params.data.coord[0][0]).format('llll')}<br />${dayjs(params.data.coord[1][0]).format('llll')}</div>`

bundles/org.openhab.ui/web/src/components/widgets/chart/oh-chart-page.vue

-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ export default {
118118
value: [value],
119119
on: {
120120
change (calendar, value) {
121-
console.log(value)
122121
if (value.length < 1) return
123122
if (dayjs(value[0]).isSame(self.startTime)) return
124123
self.setDate(value[0])

bundles/org.openhab.ui/web/src/js/openhab/speech.js

-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export default {
2626
}
2727
wksr.onresult = (event) => {
2828
if (Framework7.device.android) {
29-
console.log(event.results)
3029
let bestConfidence = 0
3130
for (let result of event.results) {
3231
for (let alternative of result) {
@@ -38,7 +37,6 @@ export default {
3837
}
3938
resultCallback({ final: false, text: interimResult })
4039
} else {
41-
console.log(event.results)
4240
interimResult = ''
4341
for (let result of event.results) {
4442
if (result.isFinal) {

bundles/org.openhab.ui/web/src/js/openhab/sse.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ function newSSEConnection (path, readyCallback, messageCallback, errorCallback)
1818
}
1919

2020
eventSource.onerror = () => {
21-
console.log('SSE error')
22-
console.log(eventSource)
21+
console.warn('SSE error')
2322
if (errorCallback) {
2423
errorCallback()
2524
}
@@ -29,7 +28,7 @@ function newSSEConnection (path, readyCallback, messageCallback, errorCallback)
2928
}
3029

3130
openSSEClients.push(eventSource)
32-
console.log(`new SSE connection: ${eventSource.url}, ${openSSEClients.length} open`)
31+
console.debug(`new SSE connection: ${eventSource.url}, ${openSSEClients.length} open`)
3332
console.debug(openSSEClients)
3433
return eventSource
3534
}
@@ -46,7 +45,7 @@ export default {
4645
if (openSSEClients.indexOf(client) >= 0) {
4746
openSSEClients.splice(openSSEClients.indexOf(client), 1)
4847
}
49-
console.log(`SSE connection closed: ${client.url}, ${openSSEClients.length} open`)
48+
console.debug(`SSE connection closed: ${client.url}, ${openSSEClients.length} open`)
5049
console.debug(openSSEClients)
5150

5251
client.close()

bundles/org.openhab.ui/web/src/pages/settings/addons/addons-add.vue

-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ export default {
9595
},
9696
startEventSource () {
9797
this.eventSource = this.$oh.sse.connect('/rest/events?topics=openhab/addons/*/*', null, (event) => {
98-
console.log(event)
9998
const topicParts = event.topic.split('/')
10099
switch (topicParts[3]) {
101100
case 'installed':

bundles/org.openhab.ui/web/src/pages/settings/items/items-list-vlist.vue

-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ export default {
165165
},
166166
startEventSource () {
167167
this.eventSource = this.$oh.sse.connect('/rest/events?topics=openhab/items/*/added,openhab/items/*/removed,openhab/items/*/updated', null, (event) => {
168-
console.log(event)
169168
const topicParts = event.topic.split('/')
170169
switch (topicParts[3]) {
171170
case 'added':

bundles/org.openhab.ui/web/src/pages/settings/items/parser/items-add-from-textual-definition.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export default {
169169
// remove existing links unless they're about to be recreated
170170
item.existingLinks.forEach((el) => {
171171
if (item.links && item.links.some((l) => l === el.channelUID || (l.value === el.channelUID))) return
172-
console.log(`DELETE /rest/links/${item.name}/${encodeURIComponent(el.channelUID)}`)
172+
console.debug(`DELETE /rest/links/${item.name}/${encodeURIComponent(el.channelUID)}`)
173173
linksAndMetadataPromises.push(this.$oh.api.delete(`/rest/links/${item.name}/${encodeURIComponent(el.channelUID)}`))
174174
})
175175
}
@@ -187,7 +187,7 @@ export default {
187187
channelUID: channelUID,
188188
configuration: config
189189
}
190-
console.log(`PUT ${url}: ` + JSON.stringify(linkPayload))
190+
console.debug(`PUT ${url}: ` + JSON.stringify(linkPayload))
191191
linksAndMetadataPromises.push(this.$oh.api.put(url, linkPayload))
192192
})
193193
}
@@ -204,7 +204,7 @@ export default {
204204
value: value,
205205
config: config
206206
}
207-
console.log(`PUT ${url}` + JSON.stringify(metadataPayload))
207+
console.debug(`PUT ${url}` + JSON.stringify(metadataPayload))
208208
linksAndMetadataPromises.push(this.$oh.api.put(url, metadataPayload))
209209
})
210210
}

bundles/org.openhab.ui/web/src/pages/settings/model/model.vue

-2
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ export default {
314314
},
315315
startEventSource () {
316316
this.eventSource = this.$oh.sse.connect('/rest/events?topics=openhab/items/*/added,openhab/items/*/updated,openhab/items/*/removed', null, (event) => {
317-
console.log(event)
318317
const topicParts = event.topic.split('/')
319318
switch (topicParts[3]) {
320319
case 'added':
@@ -475,7 +474,6 @@ export default {
475474
},
476475
on: {
477476
pageAfterOut (event, page) {
478-
console.log('Add from thing page closed')
479477
}
480478
}
481479
}

bundles/org.openhab.ui/web/src/pages/settings/rules/rule-edit.vue

-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ export default {
354354
},
355355
startEventSource () {
356356
this.eventSource = this.$oh.sse.connect('/rest/events?topics=openhab/rules/' + this.ruleId + '/*', null, (event) => {
357-
console.log(event)
358357
const topicParts = event.topic.split('/')
359358
switch (topicParts[3]) {
360359
case 'state':

bundles/org.openhab.ui/web/src/pages/settings/schedule/schedule.vue

-2
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ export default {
174174
},
175175
startEventSource () {
176176
this.eventSource = this.$oh.sse.connect('/rest/events?topics=openhab/rules/*/*', null, (event) => {
177-
console.log(event)
178177
const topicParts = event.topic.split('/')
179178
switch (topicParts[3]) {
180179
case 'added':
@@ -196,7 +195,6 @@ export default {
196195
return this.selectedItems.indexOf(item) >= 0
197196
},
198197
toggleItemCheck (event, item) {
199-
console.log('toggle check')
200198
if (this.isChecked(item)) {
201199
this.selectedItems.splice(this.selectedItems.indexOf(item), 1)
202200
} else {

bundles/org.openhab.ui/web/src/pages/settings/things/inbox/inbox-list.vue

-2
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ export default {
186186
},
187187
startEventSource () {
188188
this.eventSource = this.$oh.sse.connect('/rest/events?topics=openhab/inbox/*', null, (event) => {
189-
console.log(event)
190189
// const topicParts = event.topic.split('/')
191190
this.load()
192191
})
@@ -228,7 +227,6 @@ export default {
228227
color: 'green',
229228
bold: true,
230229
onClick: () => {
231-
console.log(`Add ${entry.thingUID} as thing`)
232230
this.$f7.dialog.prompt(`This will create a new Thing of type ${entry.thingTypeUID} with the following name:`,
233231
'Add as Thing',
234232
(name) => {

bundles/org.openhab.ui/web/src/pages/settings/things/link/link-add.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export default {
193193
this.profileTypeConfiguration = data
194194
}).catch((err) => {
195195
// just clear out the config sheet
196-
console.log(`No configuration for profile type ${profileTypeUid}: ` + err)
196+
console.warn(`No configuration for profile type ${profileTypeUid}: ` + err)
197197
this.profileTypeConfiguration = null
198198
})
199199
},

bundles/org.openhab.ui/web/src/pages/settings/things/thing-details.vue

-4
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ export default {
301301
}
302302
// When coming back from the channel add/edit page with a change, let the handler below take care of the reloading logic (the thing has to be saved first)
303303
if (!event.pageFrom || !event.pageFrom.name || event.pageFrom.name.indexOf('channel') < 0) {
304-
console.log('Loading')
305304
if (!this.eventSource) this.stopEventSource()
306305
this.load()
307306
}
@@ -426,7 +425,6 @@ export default {
426425
`${action.label}?`,
427426
this.thing.label,
428427
() => {
429-
console.log(action)
430428
thing.configuration[action.name] = true
431429
this.dirty = true
432430
save()
@@ -537,7 +535,6 @@ export default {
537535
},
538536
on: {
539537
pageAfterOut (event, page) {
540-
console.log('Add to model page closed')
541538
}
542539
}
543540
}
@@ -601,7 +598,6 @@ export default {
601598
startEventSource () {
602599
if (this.eventSource) this.stopEventSource()
603600
this.eventSource = this.$oh.sse.connect('/rest/events?topics=openhab/things/*/*,openhab/links/*/*' /* + encodeURIComponent(this.thingId) */, null, (event) => {
604-
// console.log(event)
605601
const topicParts = event.topic.split('/')
606602
switch (topicParts[1]) {
607603
case 'things':

0 commit comments

Comments
 (0)