33
44"use strict" ;
55
6- import createDotnetRuntime from './dotnet.js'
6+ import { dotnet , exit } from './dotnet.js'
77
88try {
9- const runtime = await createDotnetRuntime ( ( { INTERNAL } ) => ( {
10- configSrc : "./mono-config.json" ,
11- onConfigLoaded : ( config ) => {
12- config . environmentVariables [ "DOTNET_MODIFIABLE_ASSEMBLIES" ] = "debug" ;
13- /* For custom logging patch the functions below
14- config.diagnosticTracing = true;
15- config.environmentVariables["MONO_LOG_LEVEL"] = "debug";
16- config.environmentVariables["MONO_LOG_MASK"] = "all";
17- INTERNAL.logging = {
18- trace: (domain, log_level, message, isFatal, dataPtr) => console.log({ domain, log_level, message, isFatal, dataPtr }),
19- debugger: (level, message) => console.log({ level, message }),
20- };
21- */
22- } ,
23- } ) ) ;
9+ const runtime = await dotnet
10+ . withEnvironmentVariable ( "DOTNET_MODIFIABLE_ASSEMBLIES" , "debug" )
11+ // For custom logging patch the functions below
12+ //.withDiagnosticTracing(true)
13+ //.withEnvironmentVariable("MONO_LOG_LEVEL", "debug")
14+ //.withEnvironmentVariable("MONO_LOG_MASK", "all")
15+ . create ( ) ;
16+ /*runtime.INTERNAL.logging = {
17+ trace: (domain, log_level, message, isFatal, dataPtr) => console.log({ domain, log_level, message, isFatal, dataPtr }),
18+ debugger: (level, message) => console.log({ level, message }),
19+ };*/
2420 App . runtime = runtime ;
2521 await App . init ( ) ;
26- } catch ( err ) {
27- console . log ( `WASM ERROR ${ err } ` ) ;
2822}
23+ catch ( err ) {
24+ exit ( 2 , err ) ;
25+ }
0 commit comments