Added logging module
This commit is contained in:
Vendored
+14
-6
@@ -4709,6 +4709,19 @@
|
||||
// }
|
||||
}
|
||||
|
||||
/** Basic class for app specific logging requirements.
|
||||
* Can be used to implement persistent logging in electron apps.
|
||||
*/
|
||||
class Logging {
|
||||
|
||||
/** Static log function.
|
||||
* @param {*} message
|
||||
*/
|
||||
log(message) {
|
||||
console.log(message);
|
||||
}
|
||||
}
|
||||
|
||||
/* globals Hammer, propagating */
|
||||
|
||||
/** Interaction patterns
|
||||
@@ -5620,11 +5633,6 @@
|
||||
this.logInteractionsAbove = logInteractionsAbove;
|
||||
}
|
||||
|
||||
log(message) {
|
||||
let logger = (typeof app != 'undefined' && app.log) ? app : console;
|
||||
logger.log(message);
|
||||
}
|
||||
|
||||
get targetInterface() {
|
||||
return IInteractionMapperTarget
|
||||
}
|
||||
@@ -5647,7 +5655,7 @@
|
||||
let size = this.interaction.current.size;
|
||||
let limit = this.logInteractionsAbove;
|
||||
if (size > limit) {
|
||||
this.log(`Number of interactions ${size} exceeds ${limit}`);
|
||||
Logging.log(`Number of interactions ${size} exceeds ${limit}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user