@@ -9,7 +9,9 @@ import product from "vs/platform/product/node/product";
99
1010import { MainServer } from "vs/server/src/server" ;
1111import "vs/server/src/tar" ;
12- import { AuthType , buildAllowedMessage , generateCertificate , generatePassword , open , unpackExecutables } from "vs/server/src/util" ;
12+ import { AuthType , buildAllowedMessage , generateCertificate , generatePassword , localRequire , open , unpackExecutables } from "vs/server/src/util" ;
13+
14+ const { logger } = localRequire < typeof import ( "@coder/logger/out/index" ) > ( "@coder/logger/out/index" ) ;
1315
1416interface Args extends ParsedArgs {
1517 auth ?: AuthType ;
@@ -67,7 +69,7 @@ interface IMainCli {
6769 main : ( argv : ParsedArgs ) => Promise < void > ;
6870}
6971
70- const main = async ( ) : Promise < void > => {
72+ const main = async ( ) : Promise < void | void [ ] > => {
7173 const args = validatePaths ( parseMainProcessArgv ( process . argv ) ) as Args ;
7274 [ "extra-extensions-dir" , "extra-builtin-extensions-dir" ] . forEach ( ( key ) => {
7375 if ( typeof args [ key ] === "string" ) {
@@ -91,7 +93,7 @@ const main = async (): Promise<void> => {
9193 }
9294
9395 if ( args . version ) {
94- return console . log ( buildVersionMessage ( version , product . commit ) ) ;
96+ return buildVersionMessage ( version , product . commit ) . split ( "\n" ) . map ( ( line ) => logger . info ( line ) ) ;
9597 }
9698
9799 const shouldSpawnCliProcess = ( ) : boolean => {
@@ -146,32 +148,32 @@ const main = async (): Promise<void> => {
146148 server . listen ( ) ,
147149 unpackExecutables ( ) ,
148150 ] ) ;
149- console . log ( `Server listening on ${ serverAddress } ` ) ;
151+ logger . info ( `Server listening on ${ serverAddress } ` ) ;
150152
151153 if ( options . auth && ! process . env . PASSWORD ) {
152- console . log ( " - Password is" , options . password ) ;
153- console . log ( " - To use your own password, set the PASSWORD environment variable" ) ;
154+ logger . info ( ` - Password is ${ options . password } ` ) ;
155+ logger . info ( " - To use your own password, set the PASSWORD environment variable" ) ;
154156 } else if ( options . auth ) {
155- console . log ( " - Using custom password for authentication" ) ;
157+ logger . info ( " - Using custom password for authentication" ) ;
156158 } else {
157- console . log ( " - No authentication" ) ;
159+ logger . info ( " - No authentication" ) ;
158160 }
159161
160162 if ( server . protocol === "https" ) {
161- console . log (
163+ logger . info (
162164 args . cert
163165 ? ` - Using provided certificate${ args [ "cert-key" ] ? " and key" : "" } for HTTPS`
164166 : ` - Using generated certificate and key for HTTPS` ,
165167 ) ;
166168 } else {
167- console . log ( " - Not serving HTTPS" ) ;
169+ logger . info ( " - Not serving HTTPS" ) ;
168170 }
169171
170172 if ( ! server . options . socket && args . open ) {
171173 // The web socket doesn't seem to work if using 0.0.0.0.
172174 const openAddress = `http://localhost:${ server . options . port } ` ;
173175 await open ( openAddress ) . catch ( console . error ) ;
174- console . log ( ` - Opened ${ openAddress } ` ) ;
176+ logger . info ( ` - Opened ${ openAddress } ` ) ;
175177 }
176178} ;
177179
0 commit comments