(...args)
| 1249 | } |
| 1250 | |
| 1251 | log(...args) { |
| 1252 | let options; |
| 1253 | |
| 1254 | const last = _.last(args); |
| 1255 | |
| 1256 | if (last && _.isPlainObject(last) && Object.prototype.hasOwnProperty.call(last, 'logging')) { |
| 1257 | options = last; |
| 1258 | |
| 1259 | // remove options from set of logged arguments if options.logging is equal to console.log |
| 1260 | // eslint-disable-next-line no-console |
| 1261 | if (options.logging === console.log) { |
| 1262 | args.splice(args.length - 1, 1); |
| 1263 | } |
| 1264 | } else { |
| 1265 | options = this.options; |
| 1266 | } |
| 1267 | |
| 1268 | if (options.logging) { |
| 1269 | if (options.logging === true) { |
| 1270 | deprecations.noTrueLogging(); |
| 1271 | // eslint-disable-next-line no-console |
| 1272 | options.logging = console.log; |
| 1273 | } |
| 1274 | |
| 1275 | // second argument is sql-timings, when benchmarking option enabled |
| 1276 | // eslint-disable-next-line no-console |
| 1277 | if ((this.options.benchmark || options.benchmark) && options.logging === console.log) { |
| 1278 | args = [`${args[0]} Elapsed time: ${args[1]}ms`]; |
| 1279 | } |
| 1280 | |
| 1281 | options.logging(...args); |
| 1282 | } |
| 1283 | } |
| 1284 | |
| 1285 | /** |
| 1286 | * Close all connections used by this sequelize instance, and free all references so the instance can be garbage collected. |
no outgoing calls