aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/url.go
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/url.go')
-rw-r--r--accounts/url.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/accounts/url.go b/accounts/url.go
index a2d00c1c6..47f9d8ee4 100644
--- a/accounts/url.go
+++ b/accounts/url.go
@@ -60,6 +60,15 @@ func (u URL) String() string {
return u.Path
}
+// TerminalString implements the log.TerminalStringer interface.
+func (u URL) TerminalString() string {
+ url := u.String()
+ if len(url) > 32 {
+ return url[:31] + "…"
+ }
+ return url
+}
+
// MarshalJSON implements the json.Marshaller interface.
func (u URL) MarshalJSON() ([]byte, error) {
return json.Marshal(u.String())