feat(debug): Add timing information about time to first image/all images, and query time (#3681)
This commit is contained in:
1 parent
1b207f14d2
commit
108383b9ef
10 files changed
+125
-18
No files matched your search
@@ -4,8 +4,25 @@ const log = {
|
||||
info: console.log,
|
||||
trace: console.trace,
|
||||
debug: console.debug,
|
||||
time: console.time,
|
||||
timeEnd: console.timeEnd,
|
||||
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;
|
||||
Reference in new issue
Block a user