From 6f9666c39113c88cb4389a86a82c78200ca7262d Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 9 Jun 2014 13:11:11 +0200 Subject: added eclipse logging to the configsystem’s error reporter, and cleaned up the changelog slightly. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lombok/core/configuration/ConfigurationProblemReporter.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/core/lombok/core/configuration/ConfigurationProblemReporter.java b/src/core/lombok/core/configuration/ConfigurationProblemReporter.java index 5dbf99a8..ca0c8210 100644 --- a/src/core/lombok/core/configuration/ConfigurationProblemReporter.java +++ b/src/core/lombok/core/configuration/ConfigurationProblemReporter.java @@ -21,11 +21,20 @@ */ package lombok.core.configuration; +import lombok.eclipse.handlers.EclipseHandlerUtil; + public interface ConfigurationProblemReporter { void report(String sourceDescription, String problem, int lineNumber, CharSequence line); ConfigurationProblemReporter CONSOLE = new ConfigurationProblemReporter() { @Override public void report(String sourceDescription, String problem, int lineNumber, CharSequence line) { + try { + // The console (System.err) is non-existent in eclipse environments, so we should try to + // log into at least the error log. This isn't really the appropriate place (should go in the + // relevant file instead, most people never see anything in the error log either!), but at least + // there is a way to see it, vs. System.err, which is completely invisible. + EclipseHandlerUtil.warning(String.format("%s (%s:%d)", problem, sourceDescription, lineNumber), null); + } catch (Throwable ignore) {} System.err.printf("%s (%s:%d)\n", problem, sourceDescription, lineNumber); } }; -- cgit