Skip to content

Commit 3d7e0e5

Browse files
committed
feat: using logger for agent shutdown messages
1 parent 740c72d commit 3d7e0e5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/agent/CommandStart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ class CommandStart extends CommandPolykey {
253253
pkAgent.addEventListener(
254254
polykeyEvents.EventPolykeyAgentStop.name,
255255
() => {
256-
process.stderr.write('Stopping Agent\n');
256+
this.logger.warn('Stopping Agent');
257257
},
258258
{ once: true },
259259
);

src/agent/CommandStop.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ class CommandStop extends CommandPolykey {
2727
);
2828
const statusInfo = clientStatus.statusInfo;
2929
if (statusInfo?.status === 'DEAD') {
30-
process.stderr.write('Agent is already dead\n');
30+
this.logger.warn('Agent is already dead');
3131
return;
3232
} else if (statusInfo?.status === 'STOPPING') {
33-
process.stderr.write('Agent is already stopping\n');
33+
this.logger.warn('Agent is already stopping');
3434
return;
3535
} else if (statusInfo?.status === 'STARTING') {
3636
throw new errors.ErrorPolykeyCLIAgentStatus('Agent is starting');
@@ -62,7 +62,7 @@ class CommandStop extends CommandPolykey {
6262
}),
6363
auth,
6464
);
65-
process.stderr.write('Stopping Agent\n');
65+
this.logger.warn('Stopping Agent');
6666
} finally {
6767
if (pkClient! != null) await pkClient.stop();
6868
}

0 commit comments

Comments
 (0)