Added logging module

This commit is contained in:
2019-05-24 09:53:27 +02:00
parent becb749e02
commit 7f4b7fb1ff
5 changed files with 45 additions and 18 deletions
+15 -6
View File
@@ -1545,6 +1545,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
@@ -2456,11 +2469,6 @@
this.logInteractionsAbove = logInteractionsAbove;
}
log(message) {
let logger = (typeof app != 'undefined' && app.log) ? app : console;
logger.log(message);
}
get targetInterface() {
return IInteractionMapperTarget
}
@@ -2483,7 +2491,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}`);
}
}
@@ -7368,6 +7376,7 @@
window.InteractionMapper = InteractionMapper$1;
window.InteractionPoints = InteractionPoints;
window.Interface = Interface;
window.Logging = Logging;
window.PointMap = PointMap;
window.Rect = Rect;
window.Points = Points;
+14 -6
View File
@@ -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}`);
}
}