trilium/src/services/event_log.js
2018-04-02 20:46:46 -04:00

22 lines
473 B
JavaScript

const sql = require('./sql');
const dateUtils = require('./date_utils');
const log = require('./log');
async function addEvent(comment) {
await addNoteEvent(null, comment);
}
async function addNoteEvent(noteId, comment) {
await sql.insert('event_log', {
noteId : noteId,
comment: comment,
dateAdded: dateUtils.nowDate()
});
log.info("Event log for " + noteId + ": " + comment);
}
module.exports = {
addEvent,
addNoteEvent
};