Sequelize静音模式

时间:2016-03-25 16:10:06

标签: sequelize.js

如何在记录sql命令时使Sequelize ORM无声?

我正在使用acl-sequelize库:

var Acl = require('acl');
var Sequelize = require('sequelize');
var AclSeq = require('acl-sequelize');
var db = new Sequelize('mysql://root@localhost:3306/test');   
var acl = new Acl(new AclSeq(db, { prefix: 'acl_' }));

我怎样才能保持沉默?

1 个答案:

答案 0 :(得分:4)

在选项中,您需要将记录设置为false

var sequelize = new Sequelize('db_name', 'user', 'password', {host:host, dialect:"mysql", logging:false});