An immediate response to the user request to see the log, and then we
show the real data as soon as we've loaded it from disk.
Changes:
- the IPC exchange to get the log data is now async
- the API to fetch the log on the client side now returns a Promise
- in the main process, the only disk access done synchronoously is
reading the contents of the log directory. The JSON parsing of the
resultant log data is now split up into three chunks.
- We only send three keys from each log item to the renderer process:
msg, time, level. Previously we sent the entire log entry with extra
keys: hostname, pid, name.
FREEBIE
This should allow us to get an insight into auto-update behavior and
other low-level behaviors happening in the Electron process which would
be useful for debugging.
FREEBIE
Beacause so many of our tests have hardcoded english strings. We could do
better, but for now anyone running tests locally must simply do so in english,
even if they usually use Signal in another language.
// FREEBIE
- Logging is available in main process as well as renderer process, and
entries all go to one set of rotating files. Log entries in the
renderer process go to DevTools as well as the console. Entries from
the main process only show up in the console.
- We save three days of logs, one day per file in %userData%/logs
- The 'debug' object store is deleted in a new database migration
- Timestamps and level included in the new log we generate for publish
as well as the devtools
- The bunyan API is exposed via windows.log (providing the ability to
log at different levels, and save objects instead of just text), so we
can move our code to it over time.
FREEBIE
Just send an event from the main process to the renderer,
The latter routes it the appropriate view method.
For now it's a no-op unless the main window exists and it is showing the inbox,
which will be addressed in a future commit.
// FREEBIE