Thanks Neil, Thomas and Konstantin, great information. I have created https://bugs.eclipse.org/bugs/show_bug.cgi?id=479979 as a reminder bug for me to investigate how we could simplify the log infrastructure in platform runtime.
Thanks again, Lars On Wed, Oct 7, 2015 at 7:40 PM, Thomas Watson <tjwat...@us.ibm.com> wrote: > ILog has been around for a very long time, before OSGi as a runtime in > Eclipse I think. So its access is a bit static. If you have motivation to > access it in an 'OSGi way' then I recommend you enhance the eclipse platform > to register a ServiceFactory<ILog> that bundles can use. The > ServiceFactory<ILog> would essentially return the same thing > Platform.getLog(Bundle) does. That way you can get injected with your > bundle's ILog with things like DS. > > Tom > > > > > > From: Konstantin Komissarchik <konstantin.komissarc...@oracle.com> > To: Neil Bartlett <njbartl...@gmail.com>, Equinox development mailing > list <equinox-dev@eclipse.org> > Date: 10/07/2015 11:01 AM > Subject: Re: [equinox-dev] Accessing the log without Activator > (extendsPlugin) > Sent by: equinox-dev-boun...@eclipse.org > ________________________________ > > > > Here is the invocation that I use to get ILog without an Activator: > > Platform.getLog( Platform.getBundle( "..." ) ) > > Thanks, > > - Konstantin > > > > > From: Neil Bartlett > Sent: Wednesday, October 7, 2015 8:50 AM > To: Equinox development mailing list > Subject: Re: [equinox-dev] Accessing the log without Activator > (extendsPlugin) > > > Looking at the source code, ILog is not an OSGi service but is constructed > as a wrapper object around the OSGi LogService. The relevant code is in > org.eclipse.core.internal.runtime.InternalPlatform. > > Do you need the full functionality of an ILog, or is standard OSGi > LogService sufficient? If the latter, then you can use a DS component and > just inject a reference to the LogService. If you really need ILog then I > think you have to go through InternalPlatform.getDefault().getLog(). > > Neil > > >> On 7 Oct 2015, at 09:38, Lars Vogel <lars.vo...@vogella.com> wrote: >> >> Hi, >> >> in my Activator based on Plugin, I have this nice method: >> >> MyActivator.getDefault().getLog() which is basically Plugin.getLog(). >> >> What is the correct way to access the ILog in OSGi without an Activator? >> >> Best regards, Lars >> >> -- >> Eclipse Platform UI and e4 project co-lead >> CEO vogella GmbH >> >> Haindaalwisch 17a, 22395 Hamburg >> Amtsgericht Hamburg: HRB 127058 >> Geschäftsführer: Lars Vogel, Jennifer Nerlich de Vogel >> USt-IdNr.: DE284122352 >> Fax (032) 221739404, Email: lars.vo...@vogella.com, Web: >> http://www.vogella.com >> _______________________________________________ >> equinox-dev mailing list >> equinox-dev@eclipse.org >> To change your delivery options, retrieve your password, or unsubscribe >> from this list, visit >> https://dev.eclipse.org/mailman/listinfo/equinox-dev > > _______________________________________________ > equinox-dev mailing list > equinox-dev@eclipse.org > To change your delivery options, retrieve your password, or unsubscribe from > this list, visit > https://dev.eclipse.org/mailman/listinfo/equinox-dev > > _______________________________________________ > equinox-dev mailing list > equinox-dev@eclipse.org > To change your delivery options, retrieve your password, or unsubscribe from > this list, visit > https://dev.eclipse.org/mailman/listinfo/equinox-dev > > > _______________________________________________ > equinox-dev mailing list > equinox-dev@eclipse.org > To change your delivery options, retrieve your password, or unsubscribe from > this list, visit > https://dev.eclipse.org/mailman/listinfo/equinox-dev -- Eclipse Platform UI and e4 project co-lead CEO vogella GmbH Haindaalwisch 17a, 22395 Hamburg Amtsgericht Hamburg: HRB 127058 Geschäftsführer: Lars Vogel, Jennifer Nerlich de Vogel USt-IdNr.: DE284122352 Fax (032) 221739404, Email: lars.vo...@vogella.com, Web: http://www.vogella.com _______________________________________________ equinox-dev mailing list equinox-dev@eclipse.org To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/equinox-dev