diff options
author | Lars Vogel | 2020-01-28 09:42:21 +0000 |
---|---|---|
committer | Lars Vogel | 2020-01-28 09:42:21 +0000 |
commit | 0bae25489a737a6d13dc7e678a8bf46791716e74 (patch) | |
tree | 57b8cb8f0d7c723461e295ed6ccf20c1e6271aee | |
parent | f301429cb151971ab624519d23ef5ea19963f3d0 (diff) | |
download | eclipse.platform.ui-0bae25489a737a6d13dc7e678a8bf46791716e74.tar.gz eclipse.platform.ui-0bae25489a737a6d13dc7e678a8bf46791716e74.tar.xz eclipse.platform.ui-0bae25489a737a6d13dc7e678a8bf46791716e74.zip |
Bug 552773 - Simplify logging in platform code base
Change-Id: I7713898aa3e0aaaffb4e41e3cea2be0dadf0c505
Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de>
3 files changed, 9 insertions, 19 deletions
diff --git a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUIPlugin.java b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUIPlugin.java index d646ad940ea..eef7146161c 100644 --- a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUIPlugin.java +++ b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUIPlugin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2015 IBM Corporation and others. + * Copyright (c) 2003, 2019 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -10,6 +10,7 @@ * * Contributors: * IBM Corporation - Initial API and implementation + * Christoph Läubrich - Bug 552773 - Simplify logging in platform code base *******************************************************************************/ package org.eclipse.ui.internal.browser; @@ -18,9 +19,7 @@ import java.util.List; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtensionRegistry; -import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; /** @@ -136,9 +135,7 @@ public class WebBrowserUIPlugin extends AbstractUIPlugin { public static synchronized void logError(String message, Throwable ex) { if (message == null) message = ""; //$NON-NLS-1$ - Status errorStatus = new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, - message, ex); - WebBrowserUIPlugin.getInstance().getLog().log(errorStatus); + WebBrowserUIPlugin.getInstance().getLog().error(message, ex); } /** diff --git a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUtil.java b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUtil.java index 29b8476ac60..14e8e094a9b 100644 --- a/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUtil.java +++ b/bundles/org.eclipse.ui.browser/src/org/eclipse/ui/internal/browser/WebBrowserUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2016 IBM Corporation and others. + * Copyright (c) 2003, 2019 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -12,6 +12,7 @@ * IBM Corporation - Initial API and implementation * Martin Oberhuber (Wind River) - [292882] Default Browser on Solaris * Tomasz Zarna (Tasktop Technologies) - [429546] External Browser with parameters + * Christoph Läubrich - Bug 552773 - Simplify logging in platform code base *******************************************************************************/ package org.eclipse.ui.internal.browser; @@ -21,9 +22,7 @@ import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; -import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.util.Util; import org.eclipse.swt.SWT; @@ -142,9 +141,7 @@ public class WebBrowserUtil { } catch (Throwable t) { StringBuilder message = new StringBuilder("Internal browser is not available"); //$NON-NLS-1$ message.append(t.getMessage() == null?".":": " + t.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$ - WebBrowserUIPlugin.getInstance().getLog().log( - new Status(IStatus.WARNING, WebBrowserUIPlugin.PLUGIN_ID, - 0, message.toString() , null)); + WebBrowserUIPlugin.getInstance().getLog().warn(message.toString()); isInternalBrowserOperational = Boolean.FALSE; return false; } finally { diff --git a/bundles/org.eclipse.ui/src/org/eclipse/ui/internal/UIPreferenceInitializer.java b/bundles/org.eclipse.ui/src/org/eclipse/ui/internal/UIPreferenceInitializer.java index e0196fe5fc9..a67ce8b7583 100644 --- a/bundles/org.eclipse.ui/src/org/eclipse/ui/internal/UIPreferenceInitializer.java +++ b/bundles/org.eclipse.ui/src/org/eclipse/ui/internal/UIPreferenceInitializer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2019 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -14,12 +14,11 @@ * Tonny Madsen, RCP Company - bug 201055 * Lars Vogel <Lars.Vogel@vogella.com> - Bug 440136 * Patrik Suzzi <psuzzi@gmail.com> - Bug 485313 + * Christoph Läubrich - Bug 552773 - Simplify logging in platform code base *******************************************************************************/ package org.eclipse.ui.internal; -import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; import org.eclipse.core.runtime.preferences.DefaultScope; import org.eclipse.core.runtime.preferences.IEclipsePreferences; @@ -171,10 +170,7 @@ public class UIPreferenceInitializer extends AbstractPreferenceInitializer { .getSingleton()); } } catch (BackingStoreException e) { - IStatus status = new Status(IStatus.ERROR, UIPlugin.getDefault() - .getBundle().getSymbolicName(), IStatus.ERROR, e - .getLocalizedMessage(), e); - UIPlugin.getDefault().getLog().log(status); + UIPlugin.getDefault().getLog().error(e.getLocalizedMessage(), e); } rootNode |