diff --git a/dist/iwmlib.js b/dist/iwmlib.js index 61176f9..e5de4dd 100644 --- a/dist/iwmlib.js +++ b/dist/iwmlib.js @@ -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; diff --git a/dist/iwmlib.pixi.js b/dist/iwmlib.pixi.js index 64e5d8e..b157618 100644 --- a/dist/iwmlib.pixi.js +++ b/dist/iwmlib.pixi.js @@ -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}`); } } diff --git a/lib/bundle.js b/lib/bundle.js index 6d46d7f..67a3ea2 100755 --- a/lib/bundle.js +++ b/lib/bundle.js @@ -5,6 +5,7 @@ import Events from './events.js' import {DOMFlip, DOMFlippable, CardLoader, PDFLoader, ImageLoader, FrameLoader, HTMLLoader} from './flippable.js' import Index from './index.js' import Interface from './interface.js' +import Logging from './logging.js' import Poppable from './poppable.js' import PopupMenu from './popupmenu.js' import Popup from './popup.js' @@ -60,6 +61,7 @@ window.InteractionDelta = InteractionDelta window.InteractionMapper = InteractionMapper window.InteractionPoints = InteractionPoints window.Interface = Interface +window.Logging = Logging window.PointMap = PointMap window.Rect = Rect window.Points = Points diff --git a/lib/interaction.js b/lib/interaction.js index 5c85569..ca13508 100755 --- a/lib/interaction.js +++ b/lib/interaction.js @@ -4,6 +4,7 @@ import Interface from './interface.js' import { Points, Angle, MapProxy } from './utils.js' import Events from './events.js' +import Logging from './logging.js' /** Interaction patterns @@ -916,11 +917,6 @@ export class InteractionMapper extends InteractionDelegate { this.logInteractionsAbove = logInteractionsAbove } - log(message) { - let logger = (typeof app != 'undefined' && app.log) ? app : console - logger.log(message) - } - get targetInterface() { return IInteractionMapperTarget } @@ -943,7 +939,7 @@ export class InteractionMapper extends InteractionDelegate { 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}`) } } diff --git a/lib/logging.js b/lib/logging.js new file mode 100644 index 0000000..c73b177 --- /dev/null +++ b/lib/logging.js @@ -0,0 +1,12 @@ +/** Basic class for app specific logging requirements. + * Can be used to implement persistent logging in electron apps. + */ +export default class Logging { + + /** Static log function. + * @param {*} message + */ + log(message) { + console.log(message) + } +}