mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 21:00:57 +00:00
Rework logging colors (#3350)
- 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
6097547c10
)
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>
This commit is contained in:
committed by
GitHub
parent
098757f248
commit
6dbacbb773
11
js/utils.js
11
js/utils.js
@@ -1,21 +1,13 @@
|
||||
/* MagicMirror²
|
||||
* Utils
|
||||
*
|
||||
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
|
||||
* MIT Licensed.
|
||||
*/
|
||||
const execSync = require("node:child_process").execSync;
|
||||
const colors = require("colors/safe");
|
||||
const Log = require("logger");
|
||||
const si = require("systeminformation");
|
||||
|
||||
module.exports = {
|
||||
colors: {
|
||||
warn: colors.yellow,
|
||||
error: colors.red,
|
||||
info: colors.blue,
|
||||
pass: colors.green
|
||||
},
|
||||
|
||||
async logSystemInformation () {
|
||||
try {
|
||||
@@ -32,6 +24,9 @@ module.exports = {
|
||||
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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user