Archived
1
0

Fix parent process log level

This commit is contained in:
Asher 2023-05-04 10:40:00 -08:00
parent e02d56dbfd
commit 8c99f41b90
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A

View File

@ -172,6 +172,7 @@ export class ChildProcess extends Process {
* Initiate the handshake and wait for a response from the parent. * Initiate the handshake and wait for a response from the parent.
*/ */
public async handshake(): Promise<DefaultedArgs> { public async handshake(): Promise<DefaultedArgs> {
this.logger.debug("initiating handshake")
this.send({ type: "handshake" }) this.send({ type: "handshake" })
const message = await onMessage<ParentMessage, ParentHandshakeMessage>( const message = await onMessage<ParentMessage, ParentHandshakeMessage>(
process, process,
@ -280,6 +281,10 @@ export class ParentProcess extends Process {
} }
public start(args: DefaultedArgs): Promise<void> { public start(args: DefaultedArgs): Promise<void> {
// Our logger was created before we parsed CLI arguments so update the level
// in case it has changed.
this.logger.level = logger.level
// Store for relaunches. // Store for relaunches.
this.args = args this.args = args
if (!this.started) { if (!this.started) {
@ -306,7 +311,7 @@ export class ParentProcess extends Process {
}) })
} }
this.logger.debug(`spawned inner process ${child.pid}`) this.logger.debug(`spawned child process ${child.pid}`)
await this.handshake(child) await this.handshake(child)