From 54ed269820fa503b2289327457324477bb24f6f9 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 4 Jun 2013 16:49:24 +0300 Subject: [PATCH] Log stack trace using fine when logging toString warnings Change-Id: I4dbb5e84df78bad25fa90fc802309e433d516fd6 --- server/src/com/vaadin/data/util/LegacyPropertyHelper.java | 5 +++++ server/src/com/vaadin/server/Constants.java | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/server/src/com/vaadin/data/util/LegacyPropertyHelper.java b/server/src/com/vaadin/data/util/LegacyPropertyHelper.java index 551d7223d6..76bd57117d 100644 --- a/server/src/com/vaadin/data/util/LegacyPropertyHelper.java +++ b/server/src/com/vaadin/data/util/LegacyPropertyHelper.java @@ -60,6 +60,11 @@ public class LegacyPropertyHelper implements Serializable { getLogger().log(Level.WARNING, Constants.WARNING_LEGACY_PROPERTY_TOSTRING, p.getClass().getName()); + if (getLogger().isLoggable(Level.FINE)) { + getLogger().log(Level.FINE, + "Strack trace for legacy toString to ease debugging", + new Throwable()); + } } /** diff --git a/server/src/com/vaadin/server/Constants.java b/server/src/com/vaadin/server/Constants.java index cf1031dab2..2c041e3cf8 100644 --- a/server/src/com/vaadin/server/Constants.java +++ b/server/src/com/vaadin/server/Constants.java @@ -106,7 +106,8 @@ public interface Constants { + "\" to \"true\". To disable the legacy functionality, set \"" + Constants.SERVLET_PARAMETER_LEGACY_PROPERTY_TOSTRING + "\" to false." - + " (Note that your debugger might call toString() and trigger this message)."; + + " (Note that your debugger might call toString() and trigger this message)." + + " To find out who is calling toString(), enable FINE level logging."; static final String WARNING_UNKNOWN_LEGACY_PROPERTY_TOSTRING_VALUE = "Unknown value '{0}' for parameter " + Constants.SERVLET_PARAMETER_LEGACY_PROPERTY_TOSTRING -- 2.39.5