diff --git a/config/logs.yml b/config/logs.yml index 6d35364..c7fa7fd 100644 --- a/config/logs.yml +++ b/config/logs.yml @@ -4,6 +4,7 @@ logMainShowField: false upperCaseTable: true userField: editorFk rowExcludeField: logExclude +ignoreSystem: false excludeRegex: '__$' showFields: - name diff --git a/lib/model-loader.js b/lib/model-loader.js index 0c3a998..ca1663a 100644 --- a/lib/model-loader.js +++ b/lib/model-loader.js @@ -94,7 +94,8 @@ module.exports = class ModelLoader { ]; const globalProps = [ 'userField', - 'rowExcludeField' + 'rowExcludeField', + 'ignoreSystem' ]; for (const [schema, table, tableInfo] of schemaMap) { diff --git a/mylogger.js b/mylogger.js index 2e8b6a7..6700069 100644 --- a/mylogger.js +++ b/mylogger.js @@ -305,14 +305,16 @@ module.exports = class MyLogger { const table = evt.tableMap[evt.tableId]; const tableName = table.tableName; const tableInfo = this.schemaMap.get(table.parentSchema, tableName); + if (!tableInfo) return; - + const action = actions[eventName]; - const {rowExcludeField} = tableInfo; + const {rowExcludeField, ignoreSystem} = tableInfo; const changes = []; function isExcluded(row) { - return rowExcludeField && row[rowExcludeField]; + return (rowExcludeField && row[rowExcludeField]) + || (ignoreSystem && row.editorFk == null); } function cast(value, type) {