不要怂,就是干,撸起袖子干!

Commit 495bcca5 by Sascha Depold

added option for disabling logging

1 parent 4e43ca2e
Showing with 4 additions and 2 deletions
require(__dirname + "/SequelizeHelper") require(__dirname + "/SequelizeHelper")
require(__dirname + "/SequelizeTable") require(__dirname + "/SequelizeTable")
Sequelize = function(database, username, password) { Sequelize = function(database, username, password, options) {
this.config = { this.config = {
database: database, database: database,
username: username, username: username,
password: password password: password
} }
this.tables = {} this.tables = {}
this.options = options || {}
} }
var classMethods = { var classMethods = {
...@@ -113,7 +114,8 @@ Sequelize.prototype = { ...@@ -113,7 +114,8 @@ Sequelize.prototype = {
connection connection
.auth(this.config.database, this.config.username, this.config.password) .auth(this.config.database, this.config.username, this.config.password)
.addListener('authorized', function() { .addListener('authorized', function() {
SequelizeHelper.log("Executing the query: " + queryString) if(!self.options.disableLogging)
SequelizeHelper.log("Executing the query: " + queryString)
connection connection
.execute(queryString) .execute(queryString)
.addListener('row', function(r){ values.push(r) }) .addListener('row', function(r){ values.push(r) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!