1 /******************************************************************************* 2 * Copyright (c) 2000, 2006 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11 package org.eclipse.core.runtime; 12 13 import org.osgi.framework.Bundle; 14 15 /** 16 * A log to which status events can be written. Logs appear on individual 17 * plug-ins and on the platform itself. Clients can register log listeners which 18 * will receive notification of all log events as they come in. 19 * <p> 20 * This interface is not intended to be implemented by clients. 21 * </p> 22 * XXX Need to create a new log interface on common plugin. That interface should be a super interface of this ILog. 23 * getBundle() would stay here. In the super interface we would have getName() 24 */ 25 public interface ILog { 26 /** 27 * Adds the given log listener to this log. Subsequently the log listener will 28 * receive notification of all log events passing through this log. 29 * This method has no affect if the identical listener is already registered on this log. 30 * 31 * @param listener the listener to add to this log 32 * @see Platform#addLogListener(ILogListener) 33 */ 34 public void addLogListener(ILogListener listener); 35 36 /** 37 * Returns the plug-in with which this log is associated. 38 * 39 * @return the plug-in with which this log is associated 40 * @since 3.0 41 */ 42 public Bundle getBundle(); 43 44 /** 45 * Logs the given status. The status is distributed to the log listeners 46 * installed on this log and then to the log listeners installed on the platform. 47 * 48 * @param status the status to log 49 */ 50 public void log(IStatus status); 51 52 /** 53 * Removes the given log listener to this log. Subsequently the log listener will 54 * no longer receive notification of log events passing through this log. 55 * This method has no affect if the identical listener is not registered on this log. 56 * 57 * @param listener the listener to remove 58 * @see Platform#removeLogListener(ILogListener) 59 */ 60 public void removeLogListener(ILogListener listener); 61 } 62