Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 330105

Summary: [log] equinox log should be substitutable
Product: [Eclipse Project] Equinox Reporter: Thomas Watson <tjwatson>
Component: CompendiumAssignee: Thomas Watson <tjwatson>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: remy.suen, simon_kaegi
Version: 3.7Flags: simon_kaegi: review+
Target Milestone: 3.7 M5   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on:    
Bug Blocks: 292135    
Attachments:
Description Flags
patch none

Description Thomas Watson CLA 2010-11-12 11:22:41 EST
In preparation for bug292135 where we want to move the equinox log impl to the core framework we need to make the equinox log implementation substitutable.  This involves the bundle exporting AND importing the org.eclipse.equinox.log package as well as doing a check to see if the system bundle has registered the ExtendedLogService before registering another copy.
Comment 1 Thomas Watson CLA 2010-11-12 11:28:41 EST
Created attachment 183009 [details]
patch

This patch changes org.eclipse.equinox.log to allow a substitutable org.eclipse.equinox.log export.  This allows for only one copy of the package to be available when the framework also exports the package.  This patch also tightens up the import ranges of the other packages.

This patch also modifies the activator to not register the log services if the ExtendedLogService is already registered by the system bundle.

Finally I updated the log.tests to use Import-Package instead of requiring org.eclipse.equinox.log.  I also removed the code that was using internals to set the error stream.  Not sure why that was needed.  As far as I can tell it was to avoid messages being written to standard error, but I don't think that is required.
Comment 2 Remy Suen CLA 2010-11-12 11:47:52 EST
Is this the same logger that's used when some EventHandler listening for stuff from EventAdmin throws an exception?
Comment 3 Thomas Watson CLA 2010-11-12 11:57:06 EST
Yes, the eventAdmin implementation uses the LogService to log any errors.  My thoughts are that we would encourage bundles to use the LogService to log all their errors so that we have a common logging API for all our clients.  For our old logging APIs we will have to map them onto the (Extended)LogService.
Comment 4 Thomas Watson CLA 2011-01-06 15:58:44 EST
Simon, can you review this patch also.  If the patch in bug292135 is to be released I also want to release this patch.
Comment 5 Simon Kaegi CLA 2011-01-07 13:49:43 EST
+1 Looks fine.
Comment 6 Thomas Watson CLA 2011-01-07 14:36:39 EST
Patch released.