mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 04:02:12 +00:00
- Replacing old package `colors` by drop-in replacement `ansis` - Rework `console-stamp` config to show all Log outputs in same color (errors = red, warnings = yellow, debug = blue background (only for the label), info = blue) - This also fixes `npm run config:check` (broken since 6097547c103be1bc89c572e5bd2be50b342967fa) Feel free to let me know if the PR is too big and you want me to do individual PRs for the changes. Before:  After:  --------- Co-authored-by: Veeck <github@veeck.de>
35 lines
1.6 KiB
JavaScript
35 lines
1.6 KiB
JavaScript
/* MagicMirror²
|
|
* Utils
|
|
*
|
|
* MIT Licensed.
|
|
*/
|
|
const execSync = require("node:child_process").execSync;
|
|
const Log = require("logger");
|
|
const si = require("systeminformation");
|
|
|
|
module.exports = {
|
|
|
|
async logSystemInformation () {
|
|
try {
|
|
let installedNodeVersion = execSync("node -v", { encoding: "utf-8" }).replace("v", "").replace(/(?:\r\n|\r|\n)/g, "");
|
|
|
|
const staticData = await si.get({
|
|
system: "manufacturer, model, raspberry, virtual",
|
|
osInfo: "platform, distro, release, arch",
|
|
versions: "kernel, node, npm, pm2"
|
|
});
|
|
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["osInfo"]["platform"]}; distro: ${staticData["osInfo"]["distro"]}; release: ${staticData["osInfo"]["release"]}; arch: ${staticData["osInfo"]["arch"]}; kernel: ${staticData["versions"]["kernel"]}`;
|
|
systemDataString += `\n### VERSIONS: electron: ${process.versions.electron}; used node: ${staticData["versions"]["node"]}; installed node: ${installedNodeVersion}; npm: ${staticData["versions"]["npm"]}; pm2: ${staticData["versions"]["pm2"]}`;
|
|
systemDataString += `\n### OTHER: timeZone: ${Intl.DateTimeFormat().resolvedOptions().timeZone}; ELECTRON_ENABLE_GPU: ${process.env.ELECTRON_ENABLE_GPU}`;
|
|
Log.info(systemDataString);
|
|
|
|
// Return is currently only for jest
|
|
return systemDataString;
|
|
} catch (e) {
|
|
Log.error(e);
|
|
}
|
|
}
|
|
};
|