11.1. Different Kinds of Messages

At the highest level, tracing can be divided into simple quadrants (see Figure 11-1), based on whom the information is intended for and whether the information is about the code or the functioning of the application.

Information intended for developers is usually either about a specific defect in the code, such as an unexpected exception, or about a specific detail relating to the functioning of the application, such as why a user could not log in. That information is intended to be used for defect resolution and problem solving, and thus needs to be detailed and very specific. Tracing messages meant for developers need to explain exactly where the issue occurred, what exactly happened, and preferably what values were in play at the time of the issue.

Figure 11-1. Figure 11-1

Similarly, information intended for users can be either about the code (informing the user that a defect occurred, without the need to be specific) or about something that applies to the logic of the application (such as the fact that a given user failed to log in correctly four times in a row). Messages for users need to be simple and nontechnical, and tell them how to fix the problem. A user doesn't need to know that the person trying to log in couldn't be found in the LDAP directory at ldap://ou=Users,ou=MyCompany,o=Com. They do need to know that they presented incorrect ...

Get Code Leader: Using People, Tools, and Processes to Build Successful Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.