node-red-contrib-knx-ultimate 6.3.0 → 6.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/nodes/hue-config.js +3 -9
- package/nodes/knxUltimate-config.js +2 -2
- package/nodes/knxUltimateAI.html +2 -2
- package/nodes/matter-config.js +3 -9
- package/nodes/matterbridge-config.js +3 -9
- package/nodes/plugins/knxUltimateAI-vue/assets/app.js +4 -3
- package/nodes/plugins/knxUltimateAI-vue/assets/chunk-index.es.js +5 -5
- package/nodes/plugins/knxUltimateAI-vue/assets/chunk-jspdf.es.min.js +58 -57
- package/nodes/plugins/knxUltimateAI-vue/assets/chunk-purify.es.js +3 -3
- package/nodes/plugins/knxUltimateViewer-vue/assets/app.js +2 -1
- package/nodes/utils/sysLogger.js +65 -15
- package/package.json +14 -12
package/nodes/utils/sysLogger.js
CHANGED
|
@@ -1,34 +1,84 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* (C) 2024 Supergiovane
|
|
3
3
|
*/
|
|
4
|
-
const
|
|
4
|
+
const winston = require('winston')
|
|
5
|
+
const { format: formatMessage } = require('util')
|
|
6
|
+
|
|
7
|
+
const { combine, timestamp, label, printf, colorize, splat } = winston.format
|
|
8
|
+
const colorizer = colorize()
|
|
9
|
+
const SPLAT = Symbol.for('splat')
|
|
10
|
+
|
|
11
|
+
// Keep the application log format aligned with the KNXUltimate engine while
|
|
12
|
+
// owning a separate logger instance for each Node-RED node/configuration node.
|
|
13
|
+
winston.addColors({
|
|
14
|
+
time: 'grey',
|
|
15
|
+
module: 'bold'
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const normalizeLevel = (level) => {
|
|
19
|
+
if (level === 'trace') return 'debug'
|
|
20
|
+
if (level === 'silent') return 'disable'
|
|
21
|
+
if (level === 'success') return 'info'
|
|
22
|
+
if (['debug', 'info', 'warn', 'error', 'disable'].includes(level)) return level
|
|
23
|
+
return 'info'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const loggerFormat = (prefix) => combine(
|
|
27
|
+
winston.format((info) => {
|
|
28
|
+
const args = info[SPLAT]
|
|
29
|
+
if (Array.isArray(args) && args.length > 0) {
|
|
30
|
+
// node-color-log printed every argument even without placeholders. Format
|
|
31
|
+
// them before Winston's splat transform so existing diagnostics keep all
|
|
32
|
+
// their values while regular %s/%o messages retain Winston semantics.
|
|
33
|
+
info.message = formatMessage(info.message, ...args)
|
|
34
|
+
delete info[SPLAT]
|
|
35
|
+
}
|
|
36
|
+
return info
|
|
37
|
+
})(),
|
|
38
|
+
splat(),
|
|
39
|
+
timestamp({ format: 'YYYY-MM-DD HH:mm:ss.SSS' }),
|
|
40
|
+
winston.format((info) => {
|
|
41
|
+
info.level = String(info.level).toUpperCase()
|
|
42
|
+
return info
|
|
43
|
+
})(),
|
|
44
|
+
label({ label: String(prefix || '-').toUpperCase() }),
|
|
45
|
+
colorize({ level: true }),
|
|
46
|
+
printf((info) => {
|
|
47
|
+
const formattedTimestamp = colorizer.colorize('time', info.timestamp)
|
|
48
|
+
const formattedLabel = colorizer.colorize('module', info.label || '-')
|
|
49
|
+
return `${formattedTimestamp} ${info.level} ${formattedLabel}: ${info.message}${info.stack ? `\n${info.stack}` : ''}`
|
|
50
|
+
})
|
|
51
|
+
)
|
|
5
52
|
|
|
6
53
|
class loggerClass {
|
|
7
54
|
logLevel = 'info'
|
|
8
55
|
prefix = ''
|
|
9
56
|
constructor (options = {}) {
|
|
10
|
-
const possibleLevels = ['success', 'debug', 'info', 'warn', 'error', 'disable']
|
|
11
57
|
this.prefix = options.setPrefix || ''
|
|
12
|
-
|
|
13
|
-
this.logger = logger.createNamedLogger(this.prefix)
|
|
14
|
-
} else {
|
|
15
|
-
this.logger = logger
|
|
16
|
-
}
|
|
17
|
-
let requestedLevel = options.loglevel
|
|
18
|
-
if (!possibleLevels.includes(requestedLevel)) requestedLevel = 'info'
|
|
19
|
-
if (requestedLevel === 'trace') requestedLevel = 'debug' // Backward compatibility
|
|
20
|
-
if (requestedLevel === 'silent') requestedLevel = 'disable' // Backward compatibility
|
|
21
|
-
this.logger.setLevel(requestedLevel)
|
|
22
|
-
this.logger.setDate(() => (new Date()).toLocaleString())
|
|
58
|
+
const requestedLevel = normalizeLevel(options.loglevel)
|
|
23
59
|
this.logLevel = requestedLevel
|
|
60
|
+
this.logger = winston.createLogger({
|
|
61
|
+
level: requestedLevel === 'disable' ? 'error' : requestedLevel,
|
|
62
|
+
silent: requestedLevel === 'disable',
|
|
63
|
+
format: loggerFormat(this.prefix),
|
|
64
|
+
transports: [
|
|
65
|
+
new winston.transports.Console({
|
|
66
|
+
stderrLevels: ['error']
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
})
|
|
24
70
|
}
|
|
25
71
|
|
|
26
72
|
destroy = () => {
|
|
27
|
-
|
|
73
|
+
if (!this.logger) return
|
|
74
|
+
this.logger.silent = true
|
|
75
|
+
this.logger.close()
|
|
28
76
|
}
|
|
29
77
|
|
|
30
78
|
success = (...args) => {
|
|
31
|
-
|
|
79
|
+
// Winston's npm levels do not include "success"; preserve the legacy API
|
|
80
|
+
// and route it through the equivalent informational level.
|
|
81
|
+
this.logger.info(...args)
|
|
32
82
|
}
|
|
33
83
|
|
|
34
84
|
debug = (...args) => {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"engines": {
|
|
4
4
|
"node": ">=20.18.1"
|
|
5
5
|
},
|
|
6
|
-
"version": "6.3.
|
|
6
|
+
"version": "6.3.1",
|
|
7
7
|
"description": "KNX Ultimate is the most advanced KNX integration for Node-RED, providing secure KNX/IP communication, routing, ETS project import, Philips Hue, Matter Controller and Matter Bridge (control matter device via KNX and expose KNX GA via Matter), MQTT, diagnostics with AI, virtual devices, and powerful automation nodes. Build professional, reliable, and scalable smart home and building automation projects with minimal effort.",
|
|
8
8
|
"files": [
|
|
9
9
|
"nodes/",
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
"LICENSE"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@matter/main": "^0.17.
|
|
20
|
-
"@project-chip/matter.js": "^0.17.
|
|
19
|
+
"@matter/main": "^0.17.9",
|
|
20
|
+
"@project-chip/matter.js": "^0.17.9",
|
|
21
21
|
"dns-sync": "0.2.1",
|
|
22
22
|
"google-translate-tts": "^0.3.0",
|
|
23
|
-
"js-yaml": "4.
|
|
23
|
+
"js-yaml": "4.3.1",
|
|
24
24
|
"knxultimate": "6.0.2",
|
|
25
25
|
"lodash": "4.18.1",
|
|
26
|
-
"mqtt": "^5.15.
|
|
27
|
-
"node-color-log": "12.0.1",
|
|
26
|
+
"mqtt": "^5.15.2",
|
|
28
27
|
"ping": "0.4.4",
|
|
29
|
-
"simple-get": "4.0.1"
|
|
28
|
+
"simple-get": "4.0.1",
|
|
29
|
+
"winston": "^3.17.0"
|
|
30
30
|
},
|
|
31
31
|
"node-red": {
|
|
32
32
|
"version": ">=3.1.1",
|
|
@@ -111,6 +111,8 @@
|
|
|
111
111
|
"prepublishOnly": "npm run build",
|
|
112
112
|
"test": "npm run hue-controller:check && DEBUG_KNX_HUE_TEST=0 npm run test:unit && node scripts/check-node-load.js",
|
|
113
113
|
"test:unit": "mocha \"test/**/*.test.js\"",
|
|
114
|
+
"release:publish": "node scripts/publish-and-refresh.js",
|
|
115
|
+
"release:refresh-flows": "node scripts/publish-and-refresh.js --refresh-only",
|
|
114
116
|
"hue-controller:generate": "node scripts/generate-hue-controller-profiles.js",
|
|
115
117
|
"hue-controller:check": "node scripts/generate-hue-controller-profiles.js --check",
|
|
116
118
|
"avviaquesto-itest:light": "node test/integration/hueLiveTest.mjs",
|
|
@@ -139,12 +141,12 @@
|
|
|
139
141
|
"docs:serve:norl": "node scripts/dev-serve-docs.js"
|
|
140
142
|
},
|
|
141
143
|
"devDependencies": {
|
|
142
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
144
|
+
"@vitejs/plugin-vue": "^6.0.8",
|
|
143
145
|
"chai": "^4.3.10",
|
|
144
|
-
"jspdf": "^2.
|
|
146
|
+
"jspdf": "^4.2.1",
|
|
145
147
|
"marked": "^14.1.0",
|
|
146
148
|
"mocha": "^10.4.0",
|
|
147
|
-
"vite": "^7.
|
|
148
|
-
"vue": "^3.5.
|
|
149
|
+
"vite": "^7.3.6",
|
|
150
|
+
"vue": "^3.5.41"
|
|
149
151
|
}
|
|
150
|
-
}
|
|
152
|
+
}
|