Add toString() for redirect exception
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 27 Apr 2017 18:41:31 +0000 (20:41 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 27 Apr 2017 18:41:31 +0000 (20:41 +0200)
src/main/java/net/pterodactylus/sone/web/page/FreenetTemplatePage.java

index 4c20e1f..209019b 100644 (file)
@@ -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);
+               }
+
        }
 
 }