Skip to content

Commit 0c3e7f1

Browse files
committed
Reduces the fluff text in Status_Handling_Best_Practices
Also fixes two broken links
1 parent c922055 commit 0c3e7f1

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

docs/Status_Handling_Best_Practices.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,18 @@ Contents
3131
Introduction
3232
============
3333

34-
In software engineering and hardware engineering, serviceability is also known as supportability, and is one of the -ilities or aspects. It refers to the ability of technical support personnel to debug or perform root cause analysis in pursuit of solving a problem with a product. \[ [http://en.wikipedia.org/wiki/Serviceability](http://en.wikipedia.org/wiki/Serviceability)\]
34+
In software engineering serviceability is also known as supportability, and refers to the ability to debug or perform root cause analysis in pursuit of solving a problem with a product.
35+
Serviceability includes the logging of state and the notification of the user.
3536

36-
One of the feature of Serviceability includes the logging of state and the notification of the user.
37+
Eclipse provides a framework to manage the Log file as well as Dialog to notify the user.
38+
This framework allows provider to plug-in their diagnosis tools, providing extra value to the user.
3739

38-
Eclipse already provides different framework to manage the Log file as well as Dialog to notify the user. In Eclipse 3.3 we introduce a framework that will make the logging and Dialog consistent across the Eclipse platform. This new framework also allows provider to plug-in their diagnosis tools, providing extra value to the user.
39-
40-
This paper will explain the best practices a developer should follow to exploit this new framework appropriately using the IStatus class. The second part will explain to plug-in provider how to exploit the new ‘StatusHandler’ model, allowing them to contribute to the user interface as well as managing the IStatus we are about to show or log.
40+
This paper explains the best practices of using the IStatus class.
41+
The second part explains to plug-in provider how to exploit the new ‘StatusHandler’ model, allowing them to contribute to the user interface as well as managing the IStatus we are about to show or log.
4142

4243
Before we investigate IStatus, we need to agree on a couple basic principle about logging and error message rendering.
4344

44-
Eclipse UI best practices about Common Error Message \[ [http://wiki.eclipse.org/index.php/UI\_Best\_Practices\_v3.x#Common\_Error_Messages](http://wiki.eclipse.org/index.php/UI_Best_Practices_v3.x#Common_Error_Messages)\]
45+
Eclipse UI best practices about [Common Error Message](https://eclipse-platform.github.io/ui-best-practices/#common_error_messages)
4546

4647
Messages
4748
========
@@ -110,18 +111,12 @@ There is a lot of debate about what to log and what not to log.
110111
1. You could fill the hard drive with information and slow the process of your application
111112
2. You will scare the product administrator who will see tons of 'possible' errors fill the log.
112113

113-
There are couple best practices I gathered during my years of Support Engineer.
114-
115114
**Rule #1:** if you show it, log it The rationale is that if you do not log it, we have no persistence of the issue. If the user closes the Dialog and closes support, we will have to reproduce the problem. Of course, in the case of a client-server environment, you do not have to log it in both places. If the message comes from the server, the client part can \*just\* present the message that will contain information about the real log record in the server log, so the administrator can retrieve it. Still I would recommend you save the message only (not the whole record) in the client environment, in case the clients forgets the correlator identifier to the server log. Another possibility is to log the message at a DEBUG or TRACE level. Remember to be cautious or you will end up in Scenario #1 : Logging too little.
116115

117116
**Rule #2:** Log even expected exception Some exceptions are expected in your environment. For instance, if you connect to a database using JDBC, you may encounter the java.sql.SQLException. It may be an exception you can recover from (i.e. StaleData) or one you cannot recover from (Server is down). You should not log the StaleData exception or the log will contain too much information. The user/administrator is not interested about your internal code and how you recover. Yet you should log the unexpected exception. We recommend you log the message of an expected exception only, not the whole stackTrace, but at a WARNING or DEBUG level.
118117

119118
Other technique exists that keep a statistic view of your expected errors. This allow an administrator to realize, for instance, that the application is getting a lot of StaleException between 8pm and 9pm on Friday.
120119

121-
**Rule #3: ZZZZZZZZZZZZZZZZZZZ I DO NOT HAVE A RULE #3 :( ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ**
122-
123-
There is tons of information and documentation on the web. On interesting paper about logging exception is the following: \[ [http://dev2dev.bea.com/pub/a/2006/11/effective-exceptions.html](http://dev2dev.bea.com/pub/a/2006/11/effective-exceptions.html)\]
124-
125120
The Eclipse IStatus
126121
===================
127122

@@ -152,7 +147,9 @@ Implementing your own Status
152147

153148
You should consider the following when creating an IStatus instance.
154149

155-
1. Try to create a subclass of IStatus that will carry your specific payload. An Example in Eclipse 3.3 is the class CVSStatus. The class carries information that diagnostic tool can use to validate CVS.
150+
1. Try to create a subclass of IStatus that will carry your specific payload.
151+
An Example in Eclipse 3.3 is the class CVSStatus.
152+
The class carries information that diagnostic tool can use to validate CVS.
156153
2. Do not use IStatus.ERROR as a code. Try to use your own code. As an example, look at the Class CVSSTatus.
157154

158155
public class CVSStatus extends TeamStatus {

0 commit comments

Comments
 (0)