Skip to content

Commit

Permalink
Improve RPC logging: print resolverName() insetad of `/resolverName…
Browse files Browse the repository at this point in the history
…()` (#3777)

* Remove  from RPC resolvers logging
  • Loading branch information
beerose authored Aug 23, 2022
1 parent 69fb280 commit f6dac09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/lucky-months-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@blitzjs/rpc": patch
---

Improve RPC logging: print `resolverName()` insetad of `/resolverName()`
2 changes: 1 addition & 1 deletion packages/blitz-rpc/src/index-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f6dac09

Please sign in to comment.