Bug 320726 - Utility class to simplify logging
Summary: Utility class to simplify logging
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-23 10:21 EDT by Gregoire Dupe CLA
Modified: 2019-09-06 16:04 EDT (History)
1 user (show)

See Also:


Attachments
Patch to add a logger class (4.09 KB, patch)
2010-07-23 11:45 EDT, Gregoire Dupe CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.