Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.osgi.services/src/org/osgi/service/log/Logger.java')
-rw-r--r--bundles/org.eclipse.osgi.services/src/org/osgi/service/log/Logger.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/log/Logger.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/log/Logger.java
index a9cc36a67..3424a62fd 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/log/Logger.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/log/Logger.java
@@ -106,6 +106,15 @@ public interface Logger {
void trace(String format, Object... arguments);
/**
+ * Perform the specified operation if logging enabled for the
+ * {@link LogLevel#TRACE} level.
+ *
+ * @param consumer The operation to perform on this Logger.
+ * @throws E An exception thrown by the operation.
+ */
+ <E extends Exception> void trace(LoggerConsumer<E> consumer) throws E;
+
+ /**
* Is logging enabled for the {@link LogLevel#DEBUG} level?
*
* @return {@code true} if logging is enabled for the {@link LogLevel#DEBUG
@@ -146,6 +155,15 @@ public interface Logger {
void debug(String format, Object... arguments);
/**
+ * Perform the specified operation if logging enabled for the
+ * {@link LogLevel#DEBUG} level.
+ *
+ * @param consumer The operation to perform on this Logger.
+ * @throws E An exception thrown by the operation.
+ */
+ <E extends Exception> void debug(LoggerConsumer<E> consumer) throws E;
+
+ /**
* Is logging enabled for the {@link LogLevel#INFO} level?
*
* @return {@code true} if logging is enabled for the {@link LogLevel#INFO
@@ -186,6 +204,15 @@ public interface Logger {
void info(String format, Object... arguments);
/**
+ * Perform the specified operation if logging enabled for the
+ * {@link LogLevel#INFO} level.
+ *
+ * @param consumer The operation to perform on this Logger.
+ * @throws E An exception thrown by the operation.
+ */
+ <E extends Exception> void info(LoggerConsumer<E> consumer) throws E;
+
+ /**
* Is logging enabled for the {@link LogLevel#WARN} level?
*
* @return {@code true} if logging is enabled for the {@link LogLevel#WARN
@@ -226,6 +253,15 @@ public interface Logger {
void warn(String format, Object... arguments);
/**
+ * Perform the specified operation if logging enabled for the
+ * {@link LogLevel#WARN} level.
+ *
+ * @param consumer The operation to perform on this Logger.
+ * @throws E An exception thrown by the operation.
+ */
+ <E extends Exception> void warn(LoggerConsumer<E> consumer) throws E;
+
+ /**
* Is logging enabled for the {@link LogLevel#ERROR} level?
*
* @return {@code true} if logging is enabled for the {@link LogLevel#ERROR
@@ -266,6 +302,15 @@ public interface Logger {
void error(String format, Object... arguments);
/**
+ * Perform the specified operation if logging enabled for the
+ * {@link LogLevel#ERROR} level.
+ *
+ * @param consumer The operation to perform on this Logger.
+ * @throws E An exception thrown by the operation.
+ */
+ <E extends Exception> void error(LoggerConsumer<E> consumer) throws E;
+
+ /**
* Log a message at the {@link LogLevel#AUDIT} level.
*
* @param message The message to log.

Back to the top