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

Bug 320726

Summary: Utility class to simplify logging
Product: [Eclipse Project] Platform Reporter: Gregoire Dupe <gdupe>
Component: RuntimeAssignee: platform-runtime-inbox <platform-runtime-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: remy.suen
Version: 3.6   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch to add a logger class none

Description Gregoire Dupe CLA 2010-07-23 10:21:54 EDT
Hi,

The project MoDisco has written a utility class to simplify the use of the Eclipse’s logging API. Thanks to this utility class we can write a log in one line instead of two complex ones.

For example we can replace:

IStatus status = new Status(IStatus.WARNING, Activator.PLUGIN_ID, exception.getMessage(), exception);
Activator.getDefault().getLog().log(status);

by:

MoDiscoLogger.logWarning(e, Activator.getDefault());

This class also adds in the error message the name and version of the bundle having produced the log (which is useful to understand a bug report).

This class is not specific to the MoDisco concerns and can be shared with all the Eclipse projects. We suppose that this class could be added the plug-in org.eclipse.core.runtime.

This class can be found in the MoDisco’s SVN : https://dev.eclipse.org/svnroot/modeling/org.eclipse.mdt.modisco/plugins/trunk/org.eclipse.gmt.modisco.infra.common.core/src/org/eclipse/gmt/modisco/infra/common/core/logging/MoDiscoLogger.java

Regards,
Grégoire Dupé
Comment 1 Gregoire Dupe CLA 2010-07-23 11:45:25 EDT
Created attachment 175080 [details]
Patch to add a logger class

You can find in attachment a patch of org.eclipse.core.runtime, which contains an adaptation of the class MoDiscoLogger.

Regards,
Grégoire Dupé
Comment 2 Eclipse Webmaster CLA 2019-09-06 16:04:13 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.