(...args)
| 1167 | } |
| 1168 | |
| 1169 | log(...args) { |
| 1170 | let options; |
| 1171 | |
| 1172 | const last = _.last(args); |
| 1173 | |
| 1174 | if (last && _.isPlainObject(last) && Object.prototype.hasOwnProperty.call(last, class="st">'logging')) { |
| 1175 | options = last; |
| 1176 | |
| 1177 | class="cm">// remove options from set of logged arguments if options.logging is equal to console.log |
| 1178 | class="cm">// eslint-disable-next-line no-console |
| 1179 | if (options.logging === console.log) { |
| 1180 | args.splice(args.length - 1, 1); |
| 1181 | } |
| 1182 | } else { |
| 1183 | options = this.options; |
| 1184 | } |
| 1185 | |
| 1186 | if (options.logging) { |
| 1187 | if (options.logging === true) { |
| 1188 | deprecations.noTrueLogging(); |
| 1189 | class="cm">// eslint-disable-next-line no-console |
| 1190 | options.logging = console.log; |
| 1191 | } |
| 1192 | |
| 1193 | class="cm">// second argument is sql-timings, when benchmarking option enabled |
| 1194 | class="cm">// eslint-disable-next-line no-console |
| 1195 | if ((this.options.benchmark || options.benchmark) && options.logging === console.log) { |
| 1196 | args = [`${args[0]} Elapsed time: ${args[1]}ms`]; |
| 1197 | } |
| 1198 | |
| 1199 | options.logging(...args); |
| 1200 | } |
| 1201 | } |
| 1202 | |
| 1203 | /** |
| 1204 | * Close all connections used by this sequelize instance, and free all references so the instance can be garbage collected. |
no outgoing calls