trilium/services/event_log.js

22 lines
483 B
JavaScript
Raw Normal View History

const sql = require('./sql');
const utils = require('./utils');
2017-11-06 10:56:42 +08:00
const log = require('./log');
async function addEvent(db, comment) {
await addNoteEvent(db, null, comment);
}
async function addNoteEvent(db, noteId, comment) {
await sql.insert(db, 'event_log', {
note_id : noteId,
comment: comment,
date_added: utils.nowTimestamp()
});
2017-11-06 10:56:42 +08:00
log.info("Event log for " + noteId + ": " + comment);
}
module.exports = {
addEvent,
addNoteEvent
};