import Ember from "ember";
import argv from "nwjs/argv";
import { isDebug } from "nwjs/debug";
import Logger from "utils/Logger";


const { logDebug, logError } = new Logger( "Application" );


Ember.onerror = err => logError( err );

global.process.on( "uncaughtException", err => {
	if ( isDebug ) {
		/* eslint-disable no-console */
		console.error( err );
	} else {
		logError( err );
	}
});

logDebug( "Parameters", argv );

@@ -1,12 +1,31 @@
+/* global DEBUG */%0A
 import Ember
@@ -73,46 +73,8 @@
 v%22;%0A
-import %7B isDebug %7D from %22nwjs/debug%22;%0A
 impo
@@ -168,16 +168,52 @@
 n%22 );%0A%0A%0A
+const emberOnError = Ember.onerror;%0A
 Ember.on
@@ -219,23 +219,38 @@
 nerror =
+ async
  err =%3E
+ %7B%0A%09await
  logErro
@@ -258,16 +258,41 @@
 ( err );
+%0A%09emberOnError( err );%0A%7D;
 %0A%0Aglobal
@@ -344,15 +344,13 @@
 f ( 
-isDebug
+DEBUG
  ) %7B
@@ -449,36 +449,180 @@
 );%0A%0A
-logDebug( %22Parameters%22, argv );
+// don't log parameters when running a dev build via grunt%0Aif ( !DEBUG ) %7B%0A%09logDebug( %22Parameters%22, argv );%0A%7D else %7B%0A%09/* eslint-disable no-console */%0A%09console.debug( argv );%0A%7D
 %0A

Fix Ember.onerror