@@ -4,7 +4,6 @@ const path = require('path');
44const cProcess = require ( 'child_process' ) . spawn ;
55const portscanner = require ( 'portscanner' ) ;
66const imageSize = require ( 'image-size' ) ;
7- const chalk = require ( 'chalk' ) ;
87let io , server , browserWindows , ipc , apiProcess , loadURL ;
98let appApi , menu , dialogApi , notification , tray , webContents ;
109let globalShortcut , shellApi , screen , clipboard , autoUpdater ;
@@ -56,7 +55,7 @@ app.on('ready', () => {
5655
5756 // hostname needs to belocalhost, otherwise Windows Firewall will be triggered.
5857 portscanner . findAPortNotInUse ( 8000 , 65535 , 'localhost' , function ( error , port ) {
59- console . log ( chalk . blue ( 'Electron Socket IO Port: ' + port ) ) ;
58+ console . log ( 'Electron Socket IO Port: ' + port ) ;
6059 startSocketApiBridge ( port ) ;
6160 } ) ;
6261
@@ -76,8 +75,8 @@ function startSplashScreen() {
7675 let imageFile = path . join ( currentBinPath , manifestJsonFile . splashscreen . imageFile ) ;
7776 imageSize ( imageFile , ( error , dimensions ) => {
7877 if ( error ) {
79- console . log ( chalk . bold . red ( `load splashscreen error:` ) ) ;
80- console . log ( chalk . bold . red ( error ) ) ;
78+ console . log ( `load splashscreen error:` ) ;
79+ console . error ( error ) ;
8180
8281 throw new Error ( error . message ) ;
8382 }
@@ -118,7 +117,7 @@ function startSocketApiBridge(port) {
118117
119118 server . listen ( port , 'localhost' ) ;
120119 server . on ( 'listening' , function ( ) {
121- console . log ( chalk . bgGreenBright ( 'Electron Socket started on port %s at %s' , server . address ( ) . port , server . address ( ) . address ) ) ;
120+ console . log ( 'Electron Socket started on port %s at %s' , server . address ( ) . port , server . address ( ) . address ) ;
122121 // Now that socket connection is established, we can guarantee port will not be open for portscanner
123122 if ( watchable ) {
124123 startAspCoreBackendWithWatch ( port ) ;
@@ -137,7 +136,7 @@ function startSocketApiBridge(port) {
137136 // otherwise it will fire the same event multiple depends how many time
138137 // live reload watch happen.
139138 socket . on ( 'disconnect' , function ( ) {
140- console . log ( chalk . bold . red ( 'Got disconnect!' ) ) ;
139+ console . log ( 'Got disconnect!' ) ;
141140 delete require . cache [ require . resolve ( './api/app' ) ] ;
142141 delete require . cache [ require . resolve ( './api/browserWindows' ) ] ;
143142 delete require . cache [ require . resolve ( './api/commandLine' ) ] ;
@@ -157,7 +156,7 @@ function startSocketApiBridge(port) {
157156
158157 global [ 'electronsocket' ] = socket ;
159158 global [ 'electronsocket' ] . setMaxListeners ( 0 ) ;
160- console . log ( chalk . bold . bgCyan ( 'ASP.NET Core Application connected...' , 'global.electronsocket' , global [ 'electronsocket' ] . id , new Date ( ) ) ) ;
159+ console . log ( 'ASP.NET Core Application connected...' , 'global.electronsocket' , global [ 'electronsocket' ] . id , new Date ( ) ) ;
161160
162161 appApi = require ( './api/app' ) ( socket , app ) ;
163162 browserWindows = require ( './api/browserWindows' ) ( socket , app ) ;
@@ -186,7 +185,7 @@ function startSocketApiBridge(port) {
186185 hostHook . onHostReady ( ) ;
187186 }
188187 } catch ( error ) {
189- console . log ( chalk . bold . red ( error . message ) ) ;
188+ console . error ( error . message ) ;
190189 }
191190 } ) ;
192191}
@@ -252,7 +251,7 @@ function startAspCoreBackendWithWatch(electronPort) {
252251 apiProcess = cProcess ( 'dotnet' , parameters , options ) ;
253252
254253 apiProcess . stdout . on ( 'data' , ( data ) => {
255- console . log ( chalk . bold . blue ( ` ${ data . toString ( ) } `) ) ;
254+ console . log ( `stdout: ${ data . toString ( ) } `) ;
256255 } ) ;
257256 }
258257}
0 commit comments