Skip to content

Commit

Permalink
Update system information (MagicMirrorOrg#3337)
Browse files Browse the repository at this point in the history
- Add ELECTRON_ENABLE_GPU
- Remove docker version
- Differentiation between installed and used node version
- Highlight "Ready to go!" for server mode (Since we display system
information in the console, it is easy to overlook this important line.)

## Electron mode

### Before

```bash
[07.01.2024 16:37.30.591] [INFO]  System information:
 ### SYSTEM:   manufacturer: Notebook; model: N650DU; raspberry: undefined; virtual: false
 ### OS:       platform: linux; distro: Debian GNU/Linux; release: 12; arch: x64; kernel: 5.10.0-20-amd64
 ### VERSIONS: electron: 27.2.0; node: 18.17.1; npm: 10.2.4; pm2: 5.3.0; docker: 20.10.24+dfsg1
 ### OTHER:    timeZone: Europe/Berlin
```

### After

```bash
[07.01.2024 16:39.04.736] [INFO]  System information:
### SYSTEM:   manufacturer: Notebook; model: N650DU; raspberry: undefined; virtual: false
### OS:       platform: linux; distro: Debian GNU/Linux; release: 12; arch: x64; kernel: 5.10.0-20-amd64
### VERSIONS: electron: 27.2.0; used node: 18.17.1; installed node: 21.1.0; npm: 10.2.4; pm2: 5.3.0
### OTHER:    timeZone: Europe/Berlin; ELECTRON_ENABLE_GPU: undefined
```

## server mode

### Before

```bash
[07.01.2024 16:36.49.106] [LOG]   
Ready to go! Please point your browser to: http://localhost:8080
[07.01.2024 16:36.49.287] [INFO]  System information:
 ### SYSTEM:   manufacturer: Notebook; model: N650DU; raspberry: undefined; virtual: false
 ### OS:       platform: linux; distro: Debian GNU/Linux; release: 12; arch: x64; kernel: 5.10.0-20-amd64
 ### VERSIONS: electron: undefined; node: 21.1.0; npm: 10.2.4; pm2: 5.3.0; docker: 20.10.24+dfsg1
 ### OTHER:    timeZone: Europe/Berlin
```

### After

```bash
[2024-01-07 16:33:53.804] [INFO]  
>>>   Ready to go! Please point your browser to: http://localhost:8080   <<< 
[2024-01-07 16:33:53.997] [INFO]  System information:
### SYSTEM:   manufacturer: Notebook; model: N650DU; raspberry: undefined; virtual: false
### OS:       platform: linux; distro: Debian GNU/Linux; release: 12; arch: x64; kernel: 5.10.0-20-amd64
### VERSIONS: electron: undefined; used node: 21.1.0; installed node: 21.1.0; npm: 10.2.4; pm2: 5.3.0
### OTHER:    timeZone: Europe/Berlin; ELECTRON_ENABLE_GPU: undefined 
```
  • Loading branch information
KristjanESPERANTO committed Jan 7, 2024
1 parent 6097547 commit 407072d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ _This release is scheduled to be released on 2024-04-01._

### Added

- Output of system information to the console for troubleshooting (#3328).
- Output of system information to the console for troubleshooting (#3328 and #3337)

### Updated

Expand Down
10 changes: 6 additions & 4 deletions js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
* MIT Licensed.
*/
const execSync = require("child_process").execSync;
const colors = require("colors/safe");
const Log = require("logger");
const si = require("systeminformation");
Expand All @@ -18,12 +19,13 @@ 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.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}`;
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}; 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);
} catch (e) {
Log.error(e);
Expand Down
2 changes: 1 addition & 1 deletion serveronly/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ const Log = require("../js/logger");
app.start().then((config) => {
const bindAddress = config.address ? config.address : "localhost";
const httpType = config.useHttps ? "https" : "http";
Log.log(`\nReady to go! Please point your browser to: ${httpType}://${bindAddress}:${config.port}`);
Log.info(`\n>>> Ready to go! Please point your browser to: ${httpType}://${bindAddress}:${config.port} <<<`);
});

0 comments on commit 407072d

Please sign in to comment.