diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f552cc368..3014d88910 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/). -❤️ **Donate:** Enjoying MagicMirror²? [Please consider a donation!](https://magicmirror.builders/donate) With your help we can continue to improve the MagicMirror². +❤️ **Donate:** Enjoying MagicMirror²? [Please consider a donation!](https://magicmirror.builders/#donate) With your help we can continue to improve the MagicMirror². ## [2.27.0] - Develop Branch (unreleased) @@ -11,6 +11,8 @@ _This release is scheduled to be released on 2024-04-01._ ### Added +- Output of system information to the console for troubleshooting (#3328). + ### Updated ### Fixed diff --git a/js/app.js b/js/app.js index eabdf73112..7f4335efaf 100644 --- a/js/app.js +++ b/js/app.js @@ -21,6 +21,9 @@ const defaultModules = require(`${__dirname}/../modules/default/defaultmodules`) global.version = require(`${__dirname}/../package.json`).version; Log.log(`Starting MagicMirror: v${global.version}`); +// Log system information. +Utils.logSystemInformation(); + // global absolute root path global.root_path = path.resolve(`${__dirname}/../`); diff --git a/js/utils.js b/js/utils.js index d111afca23..38f6ca8ba1 100644 --- a/js/utils.js +++ b/js/utils.js @@ -5,6 +5,8 @@ * MIT Licensed. */ const colors = require("colors/safe"); +const Log = require("logger"); +const si = require("systeminformation"); module.exports = { colors: { @@ -12,5 +14,19 @@ module.exports = { error: colors.red, info: colors.blue, pass: colors.green + }, + + async logSystemInformation () { + try { + const staticData = await si.getStaticData(); + let systemDataString = "System information:"; + systemDataString += `\n ### SYSTEM: manufacturer: ${staticData["system"]["manufacturer"]}; model: ${staticData["system"]["model"]}; raspberry: ${staticData["system"]["raspberry"]}; virtual: ${staticData["system"]["virtual"]}`; + systemDataString += `\n ### OS: platform: ${staticData["os"]["platform"]}; distro: ${staticData["os"]["distro"]}; release: ${staticData["os"]["release"]}; arch: ${staticData["os"]["arch"]}; kernel: ${staticData["versions"]["kernel"]}`; + systemDataString += `\n ### VERSIONS: electron: ${process.versions.electron}; node: ${staticData["versions"]["node"]}; npm: ${staticData["versions"]["npm"]}; pm2: ${staticData["versions"]["pm2"]}; docker: ${staticData["versions"]["docker"]}`; + systemDataString += `\n ### OTHER: timeZone: ${Intl.DateTimeFormat().resolvedOptions().timeZone}`; + Log.info(systemDataString); + } catch (e) { + Log.error(e); + } } }; diff --git a/package-lock.json b/package-lock.json index b20fbb0054..3e1330b197 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,8 @@ "module-alias": "^2.2.3", "moment": "^2.30.1", "node-ical": "^0.17.1", - "socket.io": "^4.7.2" + "socket.io": "^4.7.2", + "systeminformation": "^5.21.22" }, "devDependencies": { "@stylistic/eslint-plugin": "^1.5.1", @@ -9297,6 +9298,31 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, + "node_modules/systeminformation": { + "version": "5.21.22", + "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.21.22.tgz", + "integrity": "sha512-gNHloAJSyS+sKWkwvmvozZ1eHrdVTEsynWMTY6lvLGBB70gflkBQFw8drXXr1oEXY84+Vr9tOOrN8xHZLJSycA==", + "os": [ + "darwin", + "linux", + "win32", + "freebsd", + "openbsd", + "netbsd", + "sunos", + "android" + ], + "bin": { + "systeminformation": "lib/cli.js" + }, + "engines": { + "node": ">=8.0.0" + }, + "funding": { + "type": "Buy me a coffee", + "url": "https://www.buymeacoffee.com/systeminfo" + } + }, "node_modules/table": { "version": "6.8.1", "resolved": "https://registry.npmjs.org/table/-/table-6.8.1.tgz", diff --git a/package.json b/package.json index 4bd3139981..17151bba14 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,8 @@ "module-alias": "^2.2.3", "moment": "^2.30.1", "node-ical": "^0.17.1", - "socket.io": "^4.7.2" + "socket.io": "^4.7.2", + "systeminformation": "^5.21.22" }, "lint-staged": { "*": "prettier --write",