Move logging to disk via bunyan

- 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
This commit is contained in:
Scott Nonnenberg 2017-09-25 15:00:19 -07:00
parent 33f5a804fe
commit 6b11f67dc6
No known key found for this signature in database
GPG key ID: A4931C09644C654B
12 changed files with 315 additions and 108 deletions

View file

@ -97,6 +97,16 @@
messages.createIndex('unique', ['source', 'sourceDevice', 'sent_at'], { unique: true });
next();
}
},
{
version: "16.0",
migrate: function(transaction, next) {
console.log('migration 16.0');
console.log('Dropping log table, since we now log to disk');
var messages = transaction.db.deleteObjectStore('debug');
next();
}
}
];
}());