All files / platform/core/src log.js

100% Statements 7/7
100% Branches 1/1
100% Functions 2/2
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 2934x             136x 136x     184x 15x   169x 169x                          
const log = {
  error: console.error,
  warn: console.warn,
  info: console.log,
  trace: console.trace,
  debug: console.debug,
  time: key => {
    log.timingKeys[key] = true;
    console.time(key);
  },
  timeEnd: key => {
    if (!log.timingKeys[key]) {
      return;
    }
    log.timingKeys[key] = false;
    console.timeEnd(key);
  },
  // Store the timing keys to allow knowing whether or not to log events
  timingKeys: {
    // script time values are added during the index.html initial load,
    // before log (this file) is loaded, and the log
    // can't depend on the enums, so for this case recreate the string.
    // See TimingEnum for details
    scriptToView: true,
  },
};
 
export default log;