LoginSignup
5
4

More than 5 years have passed since last update.

sequelizeでsqlのログを何らかのロギングモジュールで出したいとき

Last updated at Posted at 2013-09-09
options.logging = function(args) {
  logger.debug(args);
};

var sequelize = new Sequelize(db, username,  password, options);

だめなパターン

options.logging = logger.debug

functionだけを渡せばいいじゃないかと思って試したが、だめだった。幾つかのモジュールを見た感じではdebug関数(=ログ出力関数)の中でloggerの何かを必要とする場合が多いので、エラーになる。

5
4
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4