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

Method log

lib/sequelize.js:1169–1201  ·  lib/sequelize.js::Sequelize.log
(...args)

Source from the content-addressed store, hash-verified

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.

Callers 15

sscce.jsFile · 0.80
mainFunction · 0.80
connection.tsFile · 0.80
transFunction · 0.80
trans2Function · 0.80
trans3Function · 0.80
trans4Function · 0.80
User.tsFile · 0.80
stuffFunction · 0.80
stuffTwoFunction · 0.80
doStuffFunction · 0.80
doStuffWithUserFunction · 0.80

Calls

no outgoing calls

Tested by 1

updateFunction · 0.64