MCPcopy
hub / github.com/sequelize/sequelize / log

Method log

src/sequelize.js:1251–1283  ·  view source on GitHub ↗
(...args)

Source from the content-addressed store, hash-verified

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.

Callers 15

sscce.jsFile · 0.80
mainFunction · 0.80
teaser.jsFile · 0.80
assertMethod · 0.80
updateFunction · 0.80
support.jsFile · 0.80
query.test.jsFile · 0.80
log.test.jsFile · 0.80
connection.tsFile · 0.80
transFunction · 0.80
trans2Function · 0.80
trans3Function · 0.80

Calls

no outgoing calls

Tested by 1

updateFunction · 0.64