From: David ‘Bombe’ Roden Date: Thu, 27 Apr 2017 18:41:31 +0000 (+0200) Subject: Add toString() for redirect exception X-Git-Tag: 0.9.7^2~235 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=f0c1becb30b360bf414ca9cbdd5df61490a9393c;p=Sone.git Add toString() for redirect exception --- diff --git a/src/main/java/net/pterodactylus/sone/web/page/FreenetTemplatePage.java b/src/main/java/net/pterodactylus/sone/web/page/FreenetTemplatePage.java index 4c20e1f..209019b 100644 --- a/src/main/java/net/pterodactylus/sone/web/page/FreenetTemplatePage.java +++ b/src/main/java/net/pterodactylus/sone/web/page/FreenetTemplatePage.java @@ -17,6 +17,7 @@ package net.pterodactylus.sone.web.page; +import static java.lang.String.format; import static java.util.logging.Logger.getLogger; import java.io.IOException; @@ -157,7 +158,7 @@ public class FreenetTemplatePage implements FreenetPage, LinkEnabledCallback { long start = System.nanoTime(); processTemplate(request, templateContext); long finish = System.nanoTime(); - logger.log(Level.FINEST, String.format("Template was rendered in %.2fms.", (finish - start) / 1000000.0)); + logger.log(Level.FINEST, format("Template was rendered in %.2fms.", (finish - start) / 1000000.0)); } catch (RedirectException re1) { return new RedirectResponse(re1.getTarget()); } @@ -312,6 +313,11 @@ public class FreenetTemplatePage implements FreenetPage, LinkEnabledCallback { return target; } + @Override + public String toString() { + return format("RedirectException{target='%s'}", target); + } + } }