Mercurial > hg > orthanc-stone
diff Platforms/Wasm/stone-framework-loader.ts @ 526:548eed46f535 dev
introduced a Logger class that displays timing and source (C++/JS)
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Thu, 14 Mar 2019 19:04:35 +0100 |
parents | 5055031f4a06 |
children | 70992b38aa8a |
line wrap: on
line diff
--- a/Platforms/Wasm/stone-framework-loader.ts Tue Mar 12 18:28:25 2019 +0100 +++ b/Platforms/Wasm/stone-framework-loader.ts Thu Mar 14 19:04:35 2019 +0100 @@ -2,6 +2,7 @@ * This file contains primitives to interface with WebAssembly and * with the Stone framework. **/ +import * as Logger from './logger' export declare type InitializationCallback = () => void; @@ -56,13 +57,13 @@ public static Initialize( verbose: boolean, callback: InitializationCallback) { - console.log('Initializing WebAssembly Module'); + Logger.defaultLogger.debug('Initializing WebAssembly Module'); // (<any> window). (<any> window).StoneFrameworkModule = { preRun: [ function() { - console.log('Loading the Stone Framework using WebAssembly'); + Logger.defaultLogger.debug('Loading the Stone Framework using WebAssembly'); } ], postRun: [ @@ -70,16 +71,16 @@ // This function is called by ".js" wrapper once the ".wasm" // WebAssembly module has been loaded and compiled by the // browser - console.log('WebAssembly is ready'); + Logger.defaultLogger.debug('WebAssembly is ready'); Framework.singleton_ = new Framework(verbose); callback(); } ], print: function(text : string) { - console.log(text); + Logger.defaultLogger.infoFromCpp(text); }, printErr: function(text : string) { - console.error(text); + Logger.defaultLogger.errorFromCpp(text); }, totalDependencies: 0 };