"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultSqlInterceptor = void 0;
const core_1 = require("@midwayjs/core");
class DefaultSqlInterceptor {
    preHandle(boundSql) {
        const logging = boundSql.sqlModule.dataSourceNode.options.logging || false;
        if (logging) {
            const logger = (0, core_1.getCurrentMainApp)().getLogger('magic');
            const dataSourceName = boundSql.sqlModule.getDataSourceName();
            logger.info('执行SQL[%s]：%s，参数：%s', dataSourceName, boundSql.getSql().trim(), boundSql.parameters);
        }
    }
    postHandle(boundSql, result) {
        return result;
    }
}
exports.DefaultSqlInterceptor = DefaultSqlInterceptor;
//# sourceMappingURL=DefaultSqlInterceptor.js.map