mirror of
https://github.com/zadam/trilium.git
synced 2025-10-28 08:46:43 +01:00
more logging
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
const db = require('sqlite');
|
||||
const utils = require('./utils');
|
||||
const log = require('./log');
|
||||
|
||||
async function insert(table_name, rec) {
|
||||
const columns = Object.keys(rec).join(", ");
|
||||
@@ -55,6 +56,9 @@ async function addAudit(category, req=null, noteId=null, changeFrom=null, change
|
||||
|
||||
const browserId = req == null ? null : req.get('x-browser-id');
|
||||
|
||||
log.info("audit: " + category + ", browserId=" + browserId + ", noteId=" + noteId + ", from=" + changeFrom
|
||||
+ ", to=" + changeTo + ", comment=" + comment);
|
||||
|
||||
await execute("INSERT INTO audit_log (date_modified, category, browser_id, note_id, change_from, change_to, comment)"
|
||||
+ " VALUES (?, ?, ?, ?, ?, ?, ?)", [now, category, browserId, noteId, changeFrom, changeTo, comment]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user