diff --git a/.changeset/lucky-months-guess.md b/.changeset/lucky-months-guess.md new file mode 100644 index 0000000000..556d1775bf --- /dev/null +++ b/.changeset/lucky-months-guess.md @@ -0,0 +1,5 @@ +--- +"@blitzjs/rpc": patch +--- + +Improve RPC logging: print `resolverName()` insetad of `/resolverName()` diff --git a/packages/blitz-rpc/src/index-server.ts b/packages/blitz-rpc/src/index-server.ts index be9f21d08a..8bb0aa152a 100644 --- a/packages/blitz-rpc/src/index-server.ts +++ b/packages/blitz-rpc/src/index-server.ts @@ -158,7 +158,7 @@ export function rpcHandler(config: RpcConfig) { const routePath = "/" + relativeRoutePath const log = baseLogger().getChildLogger({ - prefix: [routePath.replace("/api/rpc/", "") + "()"], + prefix: [routePath.replace(/(\/api\/rpc)?\//, "") + "()"], }) const customChalk = new chalk.Instance({ level: log.settings.type === "json" ? 0 : chalk.level,