mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Added more logging info.
parent
902618fe4a
commit
5b8ca3628d
@ -70,6 +70,8 @@ Log.log('log'); # To log to stdout
|
||||
Log.error('error'); # To log to stderr
|
||||
```
|
||||
|
||||
By default, these log entries will go to the "browser" web console which can be accessed from the DevTools. To start MagicMirror with DevTools open, run `npm start dev` from the MagicMirror folder. If you wish to send these browser logs to the normal console (or PM2 Log Files), add `export ELECTRON_ENABLE_LOGGING=true` to the top of `~/MagicMirror/run-start.sh` and restart.
|
||||
|
||||
##### Logging From *node-helper.js*
|
||||
These are not available (AFAIK) if you are using a *node_helper.js*, so you'll have to use the standard JS loggers there. As mentioned, there are quite a [few variations](https://console.spec.whatwg.org/#namespacedef-console) of these (and they result in varying success rates) depending on where you want the message to appear.
|
||||
|
||||
@ -85,6 +87,8 @@ console.error(any... data)
|
||||
console.dir(any item, optional object? options)
|
||||
```
|
||||
|
||||
You may also want to take a look at the [MMM-Logging](https://github.com/shbatm/MMM-Logging) 3rd-party module, which will add timestamps and additional formatting to your `console.error()`, or `console.log()` calls.
|
||||
|
||||
#### Reviewing logs written to disk ####
|
||||
Check your PM2 logs with `pm2 logs mm` or check the log files in their locations:
|
||||
- `/home/pi/.pm2/pm2.log`
|
||||
|
Loading…
x
Reference in New Issue
Block a user