mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-31 21:05:37 +02:00
Bug 338492 - 'log(String, Throwable)' method. Patch by Alex Ruiz.
This commit is contained in:
parent
0c4c2720e2
commit
9738529f90
1 changed files with 31 additions and 13 deletions
|
@ -22,8 +22,12 @@ import org.osgi.framework.BundleContext;
|
||||||
* The activator class controls the plug-in life cycle
|
* The activator class controls the plug-in life cycle
|
||||||
*/
|
*/
|
||||||
public class CodanCorePlugin extends Plugin {
|
public class CodanCorePlugin extends Plugin {
|
||||||
// The plug-in ID
|
/** The plug-in ID */
|
||||||
public static final String PLUGIN_ID = "org.eclipse.cdt.codan.core"; //$NON-NLS-1$
|
public static final String PLUGIN_ID = "org.eclipse.cdt.codan.core"; //$NON-NLS-1$
|
||||||
|
/**
|
||||||
|
* The nature used to run Codan builder.
|
||||||
|
* @noreference This constant is not intended to be referenced by clients.
|
||||||
|
*/
|
||||||
public static final String NATURE_ID = CodeAnlysisNature.NATURE_ID;
|
public static final String NATURE_ID = CodeAnlysisNature.NATURE_ID;
|
||||||
// The shared instance
|
// The shared instance
|
||||||
private static CodanCorePlugin plugin;
|
private static CodanCorePlugin plugin;
|
||||||
|
@ -34,13 +38,16 @@ public class CodanCorePlugin extends Plugin {
|
||||||
public CodanCorePlugin() {
|
public CodanCorePlugin() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the preferences node for this plug-in.
|
||||||
|
*/
|
||||||
public IEclipsePreferences getStorePreferences() {
|
public IEclipsePreferences getStorePreferences() {
|
||||||
return new InstanceScope().getNode(PLUGIN_ID);
|
return InstanceScope.INSTANCE.getNode(PLUGIN_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see
|
* @see
|
||||||
* org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
|
* org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
|
||||||
*/
|
*/
|
||||||
|
@ -52,7 +59,7 @@ public class CodanCorePlugin extends Plugin {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see
|
* @see
|
||||||
* org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
|
* org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
|
||||||
*/
|
*/
|
||||||
|
@ -64,7 +71,7 @@ public class CodanCorePlugin extends Plugin {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the shared instance
|
* Returns the shared instance
|
||||||
*
|
*
|
||||||
* @return the shared instance
|
* @return the shared instance
|
||||||
*/
|
*/
|
||||||
public static CodanCorePlugin getDefault() {
|
public static CodanCorePlugin getDefault() {
|
||||||
|
@ -73,7 +80,7 @@ public class CodanCorePlugin extends Plugin {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs the specified status with this plug-in's log.
|
* Logs the specified status with this plug-in's log.
|
||||||
*
|
*
|
||||||
* @param status
|
* @param status
|
||||||
* status to log
|
* status to log
|
||||||
*/
|
*/
|
||||||
|
@ -83,19 +90,30 @@ public class CodanCorePlugin extends Plugin {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs an internal error with the specified throwable
|
* Logs an internal error with the specified throwable
|
||||||
*
|
*
|
||||||
* @param e
|
* @param e the exception to be logged
|
||||||
* the exception to be logged
|
* @noreference This method is not intended to be referenced by clients.
|
||||||
*/
|
*/
|
||||||
public static void log(Throwable e) {
|
public static void log(Throwable e) {
|
||||||
log(new Status(IStatus.ERROR, PLUGIN_ID, 1, "Internal Error", e)); //$NON-NLS-1$
|
log("Internal Error", e); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logs an internal error with the specified message and throwable
|
||||||
|
*
|
||||||
|
* @param message the error message to log
|
||||||
|
* @param e the exception to be logged
|
||||||
|
* @noreference This method is not intended to be referenced by clients.
|
||||||
|
*/
|
||||||
|
public static void log(String message, Throwable e) {
|
||||||
|
log(new Status(IStatus.ERROR, CodanCorePlugin.PLUGIN_ID, 1, message, e));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs an internal error with the specified message.
|
* Logs an internal error with the specified message.
|
||||||
*
|
*
|
||||||
* @param message
|
* @param message the error message to log
|
||||||
* the error message to log
|
* @noreference This method is not intended to be referenced by clients.
|
||||||
*/
|
*/
|
||||||
public static void log(String message) {
|
public static void log(String message) {
|
||||||
log(new Status(IStatus.ERROR, PLUGIN_ID, 1, message, null));
|
log(new Status(IStatus.ERROR, PLUGIN_ID, 1, message, null));
|
||||||
|
|
Loading…
Add table
Reference in a new issue