trilium/src/services/event_log.js

22 lines
473 B
JavaScript
Raw Normal View History

const sql = require('./sql');
2018-04-03 08:46:46 +08:00
const dateUtils = require('./date_utils');
2017-11-06 10:56:42 +08:00
const log = require('./log');
async function addEvent(comment) {
await addNoteEvent(null, comment);
}
async function addNoteEvent(noteId, comment) {
await sql.insert('event_log', {
2018-01-29 08:30:14 +08:00
noteId : noteId,
comment: comment,
2018-04-03 08:46:46 +08:00
dateAdded: dateUtils.nowDate()
});
2017-11-06 10:56:42 +08:00
log.info("Event log for " + noteId + ": " + comment);
}
module.exports = {
addEvent,
addNoteEvent
};