comparison org.eclipse.osgi/supplement/src/org/eclipse/osgi/framework/log/FrameworkLogEntry.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 11
12 // Port to the D programming language:
13 // Frank Benoit <benoit@tionex.de>
12 module org.eclipse.osgi.framework.log.FrameworkLogEntry; 14 module org.eclipse.osgi.framework.log.FrameworkLogEntry;
13 15
14 import java.lang.all; 16 import java.lang.all;
17
15 18
16 /** 19 /**
17 * A framework log entry used to log information to a FrameworkLog 20 * A framework log entry used to log information to a FrameworkLog
18 * @since 3.1 21 * @since 3.1
19 * @noextend This class is not intended to be subclassed by clients. 22 * @noextend This class is not intended to be subclassed by clients.
24 * @see #getSeverity() 27 * @see #getSeverity()
25 * @since 3.2 28 * @since 3.2
26 */ 29 */
27 public static final int OK = 0; 30 public static final int OK = 0;
28 31
29 /** 32 /**
30 * Severity constant (bit mask, value 1) indicating this log entry is informational only. 33 * Severity constant (bit mask, value 1) indicating this log entry is informational only.
31 * @see #getSeverity() 34 * @see #getSeverity()
32 * @since 3.2 35 * @since 3.2
33 */ 36 */
34 public static final int INFO = 0x01; 37 public static final int INFO = 0x01;
35 38
36 /** 39 /**
37 * Severity constant (bit mask, value 2) indicating this log entry represents a warning. 40 * Severity constant (bit mask, value 2) indicating this log entry represents a warning.
38 * @see #getSeverity() 41 * @see #getSeverity()
39 * @since 3.2 42 * @since 3.2
40 */ 43 */
41 public static final int WARNING = 0x02; 44 public static final int WARNING = 0x02;
42 45
43 /** 46 /**
44 * Severity constant (bit mask, value 4) indicating this log entry represents an error. 47 * Severity constant (bit mask, value 4) indicating this log entry represents an error.
45 * @see #getSeverity() 48 * @see #getSeverity()
46 * @since 3.2 49 * @since 3.2
47 */ 50 */
48 public static final int ERROR = 0x04; 51 public static final int ERROR = 0x04;
54 */ 57 */
55 public static final int CANCEL = 0x08; 58 public static final int CANCEL = 0x08;
56 59
57 // It would be nice to rename some of these fields but we cannot change the getter method 60 // It would be nice to rename some of these fields but we cannot change the getter method
58 // names without breaking clients. Changing only the field names would be confusing. 61 // names without breaking clients. Changing only the field names would be confusing.
59 //TODO "entry" has another meaning here - title, summary, tag are better names 62 //TODO "entry" has another meaning here - title, summary, tag are better names
60 private String entry; 63 private String entry;
61 private String message; 64 private String message;
62 //TODO get rid of this 65 //TODO get rid of this
63 private int stackCode; 66 private int stackCode;
64 //TODO: use "reason" or "cause" instead 67 //TODO: use "reason" or "cause" instead
103 this.severity = severity; 106 this.severity = severity;
104 this.bundleCode = bundleCode; 107 this.bundleCode = bundleCode;
105 } 108 }
106 109
107 /** 110 /**
108 * 111 *
109 * @return Returns the children. 112 * @return Returns the children.
110 */ 113 */
111 public FrameworkLogEntry[] getChildren() { 114 public FrameworkLogEntry[] getChildren() {
112 return children; 115 return children;
113 } 116 }
153 * The severity of a multi-entry log is defined to be the maximum 156 * The severity of a multi-entry log is defined to be the maximum
154 * severity of any of its children, or <code>OK</code> if it has 157 * severity of any of its children, or <code>OK</code> if it has
155 * no children. 158 * no children.
156 * </p> 159 * </p>
157 * 160 *
158 * @return the severity: one of <code>OK</code>, <code>ERROR</code>, 161 * @return the severity: one of <code>OK</code>, <code>ERROR</code>,
159 * <code>INFO</code>, <code>WARNING</code>, or <code>CANCEL</code> 162 * <code>INFO</code>, <code>WARNING</code>, or <code>CANCEL</code>
160 * @since 3.2 163 * @since 3.2
161 */ 164 */
162 public int getSeverity() { 165 public int getSeverity() {
163 return severity; 166 return severity;