diff options
author | laeubi | 2019-08-24 05:05:20 +0000 |
---|---|---|
committer | Christoph Läubrich | 2019-11-06 17:38:10 +0000 |
commit | 2f6f10def292de57cd4f653bc8a27450843335c3 (patch) | |
tree | 9438d73465006203755b8f4ed285fba83d0b1302 | |
parent | 71881878e560e32bc00e0a824f4971a6b0cc37f2 (diff) | |
download | eclipse.platform.runtime-2f6f10def292de57cd4f653bc8a27450843335c3.tar.gz eclipse.platform.runtime-2f6f10def292de57cd4f653bc8a27450843335c3.tar.xz eclipse.platform.runtime-2f6f10def292de57cd4f653bc8a27450843335c3.zip |
Bug 550399 - ILog should provide methods for logging with simple StringsY20191112-0030Y20191107-0440I20191114-0410I20191113-2315I20191113-1800I20191112-1800I20191111-1800I20191111-0920I20191111-0655I20191111-0435I20191111-0145I20191110-1800I20191109-1800I20191109-0650I20191109-0330I20191108-1800I20191107-1800
Change-Id: I8384a4b82246f115d186a48f56e41f67a99a9a45
Signed-off-by: laeubi <laeubi@laeubi-soft.de>
3 files changed, 73 insertions, 3 deletions
diff --git a/bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF b/bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF index 9d87683aa..a5473bb5a 100644 --- a/bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.core.runtime/META-INF/MANIFEST.MF @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName -Bundle-Version: 3.16.100.qualifier +Bundle-Version: 3.17.0.qualifier Bundle-SymbolicName: org.eclipse.core.runtime; singleton:=true Bundle-Vendor: %providerName Bundle-Activator: org.eclipse.core.internal.runtime.PlatformActivator diff --git a/bundles/org.eclipse.core.runtime/pom.xml b/bundles/org.eclipse.core.runtime/pom.xml index 299b5db28..dc3f73b17 100644 --- a/bundles/org.eclipse.core.runtime/pom.xml +++ b/bundles/org.eclipse.core.runtime/pom.xml @@ -19,7 +19,7 @@ </parent> <groupId>org.eclipse.core</groupId> <artifactId>org.eclipse.core.runtime</artifactId> - <version>3.16.100-SNAPSHOT</version> + <version>3.17.0-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> <build> <plugins> diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/ILog.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/ILog.java index 4fe0fcb22..5abb0f8b5 100644 --- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/ILog.java +++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/ILog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 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 @@ -10,6 +10,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Christoph Läubrich - add methods for logging without a IStatus object *******************************************************************************/ package org.eclipse.core.runtime; @@ -62,4 +63,73 @@ public interface ILog { * @see Platform#removeLogListener(ILogListener) */ public void removeLogListener(ILogListener listener); + + /** + * Logs a status with {@link IStatus#INFO} using this logger + * {@link Bundle#getSymbolicName()} as pluginId + * + * @param message the message to log + * @since 3.17 + */ + default void info(String message) { + log(new Status(IStatus.INFO, getBundle().getSymbolicName(), message)); + } + + /** + * Logs a status with {@link IStatus#INFO} using this logger + * {@link Bundle#getSymbolicName()} as pluginId + * + * @param message the message to log + * @param throwable an optional throwable to associate with this status + * @since 3.17 + */ + default void info(String message, Throwable throwable) { + log(new Status(IStatus.INFO, getBundle().getSymbolicName(), message, throwable)); + } + + /** + * Logs a status with {@link IStatus#WARNING} using this logger + * {@link Bundle#getSymbolicName()} as pluginId + * + * @param message the message to log + * @since 3.17 + */ + default void warn(String message) { + log(new Status(IStatus.WARNING, getBundle().getSymbolicName(), message)); + } + + /** + * Logs a status with {@link IStatus#WARNING} using this logger + * {@link Bundle#getSymbolicName()} as pluginId + * + * @param message the message to log + * @param throwable an optional throwable to associate with this status + * @since 3.17 + */ + default void warn(String message, Throwable throwable) { + log(new Status(IStatus.WARNING, getBundle().getSymbolicName(), message, throwable)); + } + + /** + * Logs a status with {@link IStatus#ERROR} using this logger + * {@link Bundle#getSymbolicName()} as pluginId + * + * @param message the message to log + * @since 3.17 + */ + default void error(String message) { + log(new Status(IStatus.ERROR, getBundle().getSymbolicName(), message)); + } + + /** + * Logs a status with {@link IStatus#ERROR} using this logger + * {@link Bundle#getSymbolicName()} as pluginId + * + * @param message the message to log + * @param throwable an optional throwable to associate with this status + * @since 3.17 + */ + default void error(String message, Throwable throwable) { + log(new Status(IStatus.ERROR, getBundle().getSymbolicName(), message, throwable)); + } } |