add source to events table

This commit is contained in:
Girish Ramakrishnan
2016-04-30 12:41:27 -07:00
parent c511019d79
commit ca8731c282
5 changed files with 15 additions and 7 deletions

View File

@@ -50,14 +50,15 @@ function EventLogError(reason, errorOrMessage) {
util.inherits(EventLogError, Error);
EventLogError.INTERNAL_ERROR = 'Internal error';
function add(action, data, callback) {
function add(action, source, data, callback) {
assert.strictEqual(typeof action, 'string');
assert.strictEqual(typeof source, 'object');
assert.strictEqual(typeof data, 'object');
assert(!callback || typeof callback === 'function');
callback = callback || NOOP_CALLBACK;
eventlogdb.add(uuid.v4(), action, data, function (error) {
eventlogdb.add(uuid.v4(), action, source, data, function (error) {
if (error) return callback(new EventLogError(EventLogError.INTERNAL_ERROR, error));
callback();