Skip to content

Commit

Permalink
Merge pull request #154 from flowforge/logging
Browse files Browse the repository at this point in the history
Clean logging & announce Dashboard setup in NR logs
  • Loading branch information
joepavitt authored Aug 30, 2023
2 parents 4c18041 + 8a26fbc commit dddca0f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
6 changes: 4 additions & 2 deletions nodes/config/ui_base.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// const Emitter = require('events').EventEmitter
const path = require('path')

const v = require('../../package.json').version

// from: https://stackoverflow.com/a/28592528/3016654
function join (...paths) {
return paths.map(function (element) {
Expand Down Expand Up @@ -53,6 +55,8 @@ module.exports = function (RED) {
res.sendFile(path.join(__dirname, '../../dist/index.html'))
})

node.log(`Node-RED Dashboard 2.0 (v${v}) started at ${config.path}`)

/**
* Create IO Server for comms between Node-RED and UI
*/
Expand Down Expand Up @@ -400,11 +404,9 @@ module.exports = function (RED) {
return
}
node.emitConfigRequested = setTimeout(() => {
console.log(`emitting config to ${Object.keys(node.connections).length} connections`)
try {
// emit config to all connected UI for this ui-base
Object.values(node.connections).forEach(socket => {
console.log('emitting config to', socket.id)
emitConfig(socket)
})
} finally {
Expand Down
3 changes: 0 additions & 3 deletions nodes/config/ui_group.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ module.exports = function (RED) {
const node = this
RED.nodes.createNode(node, config)

// which page are we rendering this page in
node.log('UI Page Constructor')

node.on('close', function (removed, done) {
node.deregister() // deregister self
done()
Expand Down
3 changes: 0 additions & 3 deletions nodes/config/ui_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ module.exports = function (RED) {
const node = this
RED.nodes.createNode(node, config)

// which UI are we rendering this page in
node.log('UI Page Constructor')

node.on('close', function (removed, done) {
node.deregister() // deregister self
done()
Expand Down

0 comments on commit dddca0f

Please sign in to comment.