use of org.apache.sling.ide.eclipse.core.debug.impl.Tracer in project sling by apache.
the class PluginLoggerRegistrar method register.
/**
* Registers a new tracer for the specified plugin
*
* @param plugin the plugin to register for
* @return the service registration
*/
public static ServiceRegistration<Logger> register(Plugin plugin) {
Dictionary<String, Object> props = new Hashtable<>();
props.put(DebugOptions.LISTENER_SYMBOLICNAME, plugin.getBundle().getSymbolicName());
BundleContext ctx = plugin.getBundle().getBundleContext();
// safe to downcast since we are registering the Tracer which implements Logger
@SuppressWarnings("unchecked") ServiceRegistration<Logger> serviceRegistration = (ServiceRegistration<Logger>) ctx.registerService(new String[] { DebugOptionsListener.class.getName(), Logger.class.getName() }, new Tracer(plugin), props);
return serviceRegistration;
}
Aggregations