comparison org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/log/FrameworkLog.d @ 105:bbe49769ec18

...
author Frank Benoit <benoit@tionex.de>
date Sun, 08 Nov 2009 12:42:30 +0100
parents 0628aaa2996c
children
comparison
equal deleted inserted replaced
104:88652073d1c2 105:bbe49769ec18
2 * Copyright (c) 2004, 2008 IBM Corporation and others. 2 * Copyright (c) 2004, 2008 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/ 10 *******************************************************************************/
11 // Port to the D programming language:
12 // Frank Benoit <benoit@tionex.de>
11 module org.eclipse.osgi.framework.log.FrameworkLog; 13 module org.eclipse.osgi.framework.log.FrameworkLog;
12 import org.eclipse.osgi.framework.log.FrameworkLogEntry;
13 14
14 import java.lang.all; 15 import java.lang.all;
16
17 import org.eclipse.osgi.framework.log.FrameworkLogEntry; // packageimport
18
15 import java.io.File; 19 import java.io.File;
16 //import java.io.IOException; 20 import java.io.IOException;
17 import java.io.Writer; 21 import java.io.Writer;
18 22
19 import org.osgi.framework.FrameworkEvent; 23 import org.osgi.framework.FrameworkEvent;
20 24
21 /** 25 /**
22 * The FramworkLog interface. A FrameworkLog implementation is provided by the 26 * The FramworkLog interface. A FrameworkLog implementation is provided by the
23 * FrameworkAdaptor and used by the Framework to log any error messages and 27 * FrameworkAdaptor and used by the Framework to log any error messages and
24 * FrameworkEvents of type ERROR. The FrameworkLog may persist the log messages 28 * FrameworkEvents of type ERROR. The FrameworkLog may persist the log messages
25 * to the filesystem or allow other ways of accessing the log information. 29 * to the filesystem or allow other ways of accessing the log information.
26 * @since 3.1 30 * @since 3.1
27 * @noimplement This interface is not intended to be implemented by clients. 31 * @noimplement This interface is not intended to be implemented by clients.
28 */ 32 */
29 public interface FrameworkLog { 33 public interface FrameworkLog {
30 /** 34 /**
31 * A service lookup constant (value "performance") indicating an 35 * A service lookup constant (value "performance") indicating an
32 * implementation of the logging service that logs performance events. 36 * implementation of the logging service that logs performance events.
33 * Create a filter with this property set to <code>"true"</code> in order to 37 * Create a filter with this property set to <code>"true"</code> in order to
34 * obtain a performance log. 38 * obtain a performance log.
35 * 39 *
36 * @since 3.1 40 * @since 3.1
37 */ 41 */
38 public static final String SERVICE_PERFORMANCE = "performance"; //$NON-NLS-1$ 42 public static final String SERVICE_PERFORMANCE = "performance"; //$NON-NLS-1$
39 43
40 /** 44 /**
50 public void log(FrameworkLogEntry logEntry); 54 public void log(FrameworkLogEntry logEntry);
51 55
52 /** 56 /**
53 * Sets the current Writer used to log messages to the specified 57 * Sets the current Writer used to log messages to the specified
54 * newWriter. If append is set to true then the content 58 * newWriter. If append is set to true then the content
55 * of the current Writer will be appended to the new Writer 59 * of the current Writer will be appended to the new Writer
56 * if possible. 60 * if possible.
57 * @param newWriter The Writer to use for logging messages. 61 * @param newWriter The Writer to use for logging messages.
58 * @param append Indicates whether the content of the current Writer 62 * @param append Indicates whether the content of the current Writer
59 * used for logging messages should be appended to the end of the new 63 * used for logging messages should be appended to the end of the new
60 * Writer. 64 * Writer.
61 */ 65 */
62 public void setWriter(Writer newWriter, bool append); 66 public void setWriter(Writer newWriter, bool append);
63 67
64 /** 68 /**
65 * Sets the current File used to log messages to a FileWriter 69 * Sets the current File used to log messages to a FileWriter
66 * using the specified File. If append is set to true then the 70 * using the specified File. If append is set to true then the
67 * content of the current Writer will be appended to the 71 * content of the current Writer will be appended to the
68 * new File if possible. 72 * new File if possible.
69 * @param newFile The File to create a new FileWriter which will be 73 * @param newFile The File to create a new FileWriter which will be
70 * used for logging messages. 74 * used for logging messages.
71 * @param append Indicates whether the content of the current Writer 75 * @param append Indicates whether the content of the current Writer
72 * used for logging messages should be appended to the end of the new 76 * used for logging messages should be appended to the end of the new
73 * File. 77 * File.
74 * @throws IOException if any problem occurs while constructing a 78 * @throws IOException if any problem occurs while constructing a
75 * FileWriter from the newFile. If this exception is thrown the 79 * FileWriter from the newFile. If this exception is thrown the
76 * FrameworkLog will not be effected and will continue to use the 80 * FrameworkLog will not be effected and will continue to use the
77 * current Writer to log messages. 81 * current Writer to log messages.
78 */ 82 */
79 public void setFile(File newFile, bool append) ; 83 public void setFile(File newFile, bool append) ;
80 84
81 /** 85 /**