mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-04 23:55:26 +02:00
[refactor] add logging capability to core plugin
in preparation for moving some persistence classes
This commit is contained in:
parent
140cb9a9fe
commit
698c707f7c
2 changed files with 12 additions and 1 deletions
|
@ -6,7 +6,8 @@ Bundle-Version: 1.0.0.qualifier
|
|||
Bundle-Activator: org.eclipse.rse.core.RSECorePlugin
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
org.eclipse.core.resources
|
||||
org.eclipse.core.resources,
|
||||
org.eclipse.rse.logging
|
||||
Eclipse-LazyStart: true
|
||||
Export-Package: org.eclipse.rse.core,
|
||||
org.eclipse.rse.core.filters,
|
||||
|
|
|
@ -22,6 +22,8 @@ import org.eclipse.core.runtime.IStatus;
|
|||
import org.eclipse.core.runtime.Plugin;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.rse.core.internal.RSECoreRegistry;
|
||||
import org.eclipse.rse.logging.Logger;
|
||||
import org.eclipse.rse.logging.LoggerFactory;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
/**
|
||||
|
@ -31,6 +33,7 @@ public class RSECorePlugin extends Plugin {
|
|||
|
||||
// the shared instance
|
||||
private static RSECorePlugin plugin;
|
||||
private Logger logger = null;
|
||||
|
||||
/**
|
||||
* @return the local machine name
|
||||
|
@ -70,6 +73,7 @@ public class RSECorePlugin extends Plugin {
|
|||
*/
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
logger = LoggerFactory.getLogger(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -77,6 +81,8 @@ public class RSECorePlugin extends Plugin {
|
|||
*/
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
super.stop(context);
|
||||
LoggerFactory.freeLogger(this);
|
||||
logger = null;
|
||||
plugin = null;
|
||||
}
|
||||
|
||||
|
@ -96,6 +102,10 @@ public class RSECorePlugin extends Plugin {
|
|||
public IRSECoreRegistry getRegistry() {
|
||||
return RSECoreRegistry.getDefault();
|
||||
}
|
||||
|
||||
public Logger getLogger() {
|
||||
return logger;
|
||||
}
|
||||
|
||||
private void log(Throwable t) {
|
||||
String pluginId = this.getBundle().getSymbolicName();
|
||||
|
|
Loading…
Add table
Reference in a new issue