Skip to content

Commit

Permalink
Minor logging changes (#225)
Browse files Browse the repository at this point in the history
A few small logging changes to align better with how the server interacts with the SDK in some cases. The most notable is that when we discover services we don't always "register" them (in dry-run mode) so that SDK should just log that it's announcing those services instead. Additionally. Using the word "registering" in logs might confuse users as it's not registering those services to restate server but rather just binding those services on the open port.
  • Loading branch information
AhmedSoliman authored Jan 11, 2024
1 parent 68f58bf commit 799761a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/server/base_restate_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export abstract class BaseRestateServer {
);
// note that this log will not print all the keys.
rlog.info(
`Registering: ${url} -> ${JSON.stringify(method, null, "\t")}`
`Binding: ${url} -> ${JSON.stringify(method, null, "\t")}`
);
}
}
Expand Down Expand Up @@ -264,7 +264,7 @@ export abstract class BaseRestateServer {
) as HostedGrpcServiceMethod<unknown, unknown>;

rlog.info(
`Registering: ${url} -> ${JSON.stringify(
`Binding: ${url} -> ${JSON.stringify(
registration.method,
null,
"\t"
Expand Down
2 changes: 1 addition & 1 deletion src/server/restate_lambda_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export class LambdaRestateServer extends BaseRestateServer {
private handleDiscovery(): APIGatewayProxyResult | APIGatewayProxyResultV2 {
// return discovery information
rlog.info(
"Answering discovery request. Registering these services: " +
"Answering discovery request. Announcing services: " +
JSON.stringify(this.discovery.services)
);
return {
Expand Down
2 changes: 1 addition & 1 deletion src/server/restate_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export class RestateServer extends BaseRestateServer {
// no method under that name. might be a discovery request
if (url.path == "/discover") {
rlog.info(
"Answering discovery request. Registering these services: " +
"Answering discovery request. Announcing services: " +
JSON.stringify(this.discovery.services)
);
await respondDiscovery(this.discovery, stream);
Expand Down

0 comments on commit 799761a

Please sign in to comment.