Skip to content

Commit

Permalink
fix(next-url): print properly using logger symbol (#36097)
Browse files Browse the repository at this point in the history
Hello,

This PR adds a method to have a custom inspect for `NextURL`

closes #35519
  • Loading branch information
Kikobeats authored Apr 12, 2022
1 parent da6f271 commit 46d3f0e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/next/server/web/next-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,23 @@ export class NextURL {
return this.href
}

[Symbol.for('edge-runtime.inspect.custom')]() {
return {
href: this.href,
origin: this.origin,
protocol: this.protocol,
username: this.username,
password: this.password,
host: this.host,
hostname: this.hostname,
port: this.port,
pathname: this.pathname,
search: this.search,
searchParams: this.searchParams,
hash: this.hash,
}
}

clone() {
return new NextURL(String(this), this[Internal].options)
}
Expand Down

0 comments on commit 46d3f0e

Please sign in to comment.