From b5d0a617f24cadf51b8d5abf7a3ae458c854c96a Mon Sep 17 00:00:00 2001 From: Andrew Gvozdev Date: Sat, 9 Feb 2013 06:53:47 -0500 Subject: [PATCH] Added logging methods with severity as parameter --- .../src/org/eclipse/cdt/core/CCorePlugin.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java index 42387484aef..22a22903a2e 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java @@ -1331,6 +1331,34 @@ public class CCorePlugin extends Plugin { log(createStatus(e)); } + /** + * Print a message in the log + * + * @param severity - desired severity of the message in the log, + * one of {@link IStatus#INFO}, {@link IStatus#WARNING} or {@link IStatus#ERROR} + * @param msg - message + * + * @since 5.5 + * @noreference This method is not intended to be referenced by clients. + */ + public static void log(int severity, String msg) { + log(new Status(severity, PLUGIN_ID, msg)); + } + + /** + * Print a message in the log accompanied by stack trace + * + * @param severity - desired severity of the message in the log, + * one of {@link IStatus#INFO}, {@link IStatus#WARNING} or {@link IStatus#ERROR} + * @param msg - message + * + * @since 5.5 + * @noreference This method is not intended to be referenced by clients. + */ + public static void logStackTrace(int severity, String msg) { + log(new Status(severity, PLUGIN_ID, msg, new Exception())); + } + /** * @noreference This method is not intended to be referenced by clients. */