MCPcopy Index your code
hub / github.com/microsoft/SandDance / _getLogFunction

Method _getLogFunction

docs/app/js/sanddance-app.js:58274–58296  ·  view source on GitHub ↗
(logLevel, message, method, args, opts)

Source from the content-addressed store, hash-verified

58272 return this.isEnabled() && this.getLevel() >= normalizeLogLevel(logLevel);
58273 }
58274 _getLogFunction(logLevel, message, method, args, opts) {
58275 if (this._shouldLog(logLevel)) {
58276 opts = normalizeArguments({
58277 logLevel,
58278 message,
58279 args,
58280 opts
58281 });
58282 method = method || opts.method;
58283 (0, _assertDefault.default)(method);
58284 opts.total = this.getTotal();
58285 opts.delta = this.getDelta();
58286 this._deltaTs = (0, _hiResTimestamp.getHiResTimestamp)();
58287 const tag = opts.tag || opts.message;
58288 if (opts.once) {
58289 if (!cache[tag]) cache[tag] = (0, _hiResTimestamp.getHiResTimestamp)();
58290 else return noop;
58291 }
58292 message = decorateMessage(this.id, opts.message, opts);
58293 return method.bind(console, message, ...opts.args);
58294 }
58295 return noop;
58296 }
58297}
58298exports.default = Log;
58299(0, _definePropertyDefault.default)(Log, "VERSION", (0, _env.VERSION));

Callers 12

warnMethod · 0.95
errorMethod · 0.95
probeMethod · 0.95
logMethod · 0.95
infoMethod · 0.95
onceMethod · 0.95
tableMethod · 0.95
timeMethod · 0.95
timeEndMethod · 0.95
timeStampMethod · 0.95
groupMethod · 0.95
groupEndMethod · 0.95

Calls 5

_shouldLogMethod · 0.95
getTotalMethod · 0.95
getDeltaMethod · 0.95
normalizeArgumentsFunction · 0.70
decorateMessageFunction · 0.70

Tested by

no test coverage detected