Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.osgi/osgi/src/org/osgi/service/log/LogService.java')
-rw-r--r--bundles/org.eclipse.osgi/osgi/src/org/osgi/service/log/LogService.java119
1 files changed, 55 insertions, 64 deletions
diff --git a/bundles/org.eclipse.osgi/osgi/src/org/osgi/service/log/LogService.java b/bundles/org.eclipse.osgi/osgi/src/org/osgi/service/log/LogService.java
index dc7a9f634..983c2b524 100644
--- a/bundles/org.eclipse.osgi/osgi/src/org/osgi/service/log/LogService.java
+++ b/bundles/org.eclipse.osgi/osgi/src/org/osgi/service/log/LogService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2000, 2013). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2000, 2016). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,141 +16,132 @@
package org.osgi.service.log;
+import org.osgi.annotation.versioning.ProviderType;
import org.osgi.framework.ServiceReference;
/**
- * Provides methods for bundles to write messages to the log.
- *
- * <p>
- * {@code LogService} methods are provided to log messages; optionally with a
- * {@code ServiceReference} object or an exception.
- *
+ * LogService for logging information.
* <p>
- * Bundles must log messages in the OSGi environment with a severity level
- * according to the following hierarchy:
- * <ol>
- * <li>{@link #LOG_ERROR}</li>
- * <li>{@link #LOG_WARNING}</li>
- * <li>{@link #LOG_INFO}</li>
- * <li>{@link #LOG_DEBUG}</li>
- * </ol>
+ * Replaced by {@link LoggerFactory}.
*
* @ThreadSafe
- * @noimplement
* @author $Id$
*/
-public interface LogService {
+@ProviderType
+public interface LogService extends LoggerFactory {
/**
* An error message (Value 1).
- *
* <p>
* This log entry indicates the bundle or service may not be functional.
+ *
+ * @deprecated Since 1.4. Replaced by {@link LogLevel#ERROR}.
*/
- public static final int LOG_ERROR = 1;
+ @Deprecated
+ int LOG_ERROR = 1;
/**
* A warning message (Value 2).
- *
* <p>
* This log entry indicates a bundle or service is still functioning but may
* experience problems in the future because of the warning condition.
+ *
+ * @deprecated Since 1.4. Replaced by {@link LogLevel#WARN}.
*/
- public static final int LOG_WARNING = 2;
+ @Deprecated
+ int LOG_WARNING = 2;
/**
* An informational message (Value 3).
- *
* <p>
* This log entry may be the result of any change in the bundle or service
* and does not indicate a problem.
+ *
+ * @deprecated Since 1.4. Replaced by {@link LogLevel#INFO}.
*/
- public static final int LOG_INFO = 3;
+ @Deprecated
+ int LOG_INFO = 3;
/**
* A debugging message (Value 4).
- *
* <p>
* This log entry is used for problem determination and may be irrelevant to
* anyone but the bundle developer.
+ *
+ * @deprecated Since 1.4. Replaced by {@link LogLevel#DEBUG}.
*/
- public static final int LOG_DEBUG = 4;
+ @Deprecated
+ int LOG_DEBUG = 4;
/**
* Logs a message.
- *
* <p>
* The {@code ServiceReference} field and the {@code Throwable} field of the
* {@code LogEntry} object will be set to {@code null}.
*
* @param level The severity of the message. This should be one of the
- * defined log levels but may be any integer that is interpreted in a
- * user defined way.
+ * defined log levels but may be any integer that is interpreted
+ * in a user defined way.
* @param message Human readable string describing the condition or
- * {@code null}.
- * @see #LOG_ERROR
- * @see #LOG_WARNING
- * @see #LOG_INFO
- * @see #LOG_DEBUG
+ * {@code null}.
+ * @deprecated Since 1.4. Replaced by {@link Logger}. See
+ * {@link LoggerFactory}.
*/
- public void log(int level, String message);
+ @Deprecated
+ void log(int level, String message);
/**
* Logs a message with an exception.
- *
* <p>
* The {@code ServiceReference} field of the {@code LogEntry} object will be
* set to {@code null}.
*
* @param level The severity of the message. This should be one of the
- * defined log levels but may be any integer that is interpreted in a
- * user defined way.
+ * defined log levels but may be any integer that is interpreted
+ * in a user defined way.
* @param message The human readable string describing the condition or
- * {@code null}.
+ * {@code null}.
* @param exception The exception that reflects the condition or
- * {@code null}.
- * @see #LOG_ERROR
- * @see #LOG_WARNING
- * @see #LOG_INFO
- * @see #LOG_DEBUG
+ * {@code null}.
+ * @deprecated Since 1.4. Replaced by {@link Logger}. See
+ * {@link LoggerFactory}.
*/
- public void log(int level, String message, Throwable exception);
+ @Deprecated
+ void log(int level, String message, Throwable exception);
/**
* Logs a message associated with a specific {@code ServiceReference}
* object.
- *
* <p>
* The {@code Throwable} field of the {@code LogEntry} will be set to
* {@code null}.
*
* @param sr The {@code ServiceReference} object of the service that this
- * message is associated with or {@code null}.
+ * message is associated with or {@code null}.
* @param level The severity of the message. This should be one of the
- * defined log levels but may be any integer that is interpreted in a
- * user defined way.
+ * defined log levels but may be any integer that is interpreted
+ * in a user defined way.
* @param message Human readable string describing the condition or
- * {@code null}.
- * @see #LOG_ERROR
- * @see #LOG_WARNING
- * @see #LOG_INFO
- * @see #LOG_DEBUG
+ * {@code null}.
+ * @deprecated Since 1.4. Replaced by {@link Logger}. See
+ * {@link LoggerFactory}.
*/
- public void log(ServiceReference sr, int level, String message);
+ @Deprecated
+ void log(ServiceReference< ? > sr, int level, String message);
/**
* Logs a message with an exception associated and a
* {@code ServiceReference} object.
*
* @param sr The {@code ServiceReference} object of the service that this
- * message is associated with.
+ * message is associated with.
* @param level The severity of the message. This should be one of the
- * defined log levels but may be any integer that is interpreted in a
- * user defined way.
+ * defined log levels but may be any integer that is interpreted
+ * in a user defined way.
* @param message Human readable string describing the condition or
- * {@code null}.
+ * {@code null}.
* @param exception The exception that reflects the condition or
- * {@code null}.
- * @see #LOG_ERROR
- * @see #LOG_WARNING
- * @see #LOG_INFO
- * @see #LOG_DEBUG
+ * {@code null}.
+ * @deprecated Since 1.4. Replaced by {@link Logger}. See
+ * {@link LoggerFactory}.
*/
- public void log(ServiceReference sr, int level, String message, Throwable exception);
+ @Deprecated
+ void log(ServiceReference< ? > sr, int level, String message,
+ Throwable exception);
}

Back to the top