Visible Workings > Trace.java User's Guide

The Trace.Java User's Guide
Brian Marick

Introduction

Definitions

System Setup

Adding Tracing

Examples

Introduction

Trace.java is a package that serves these people:

Programmers

Trace.java helps you debug your code. It is like putting in print statements, but it's more powerful and flexible.

Customer support

Suppose your system has been shipped to customers. One calls in with a problem. One of the first questions you ask is, "What were you doing before the problem happened?" Of course, the customer doesn't remember, not exactly enough. If Trace.java has been used appropriately, you can tell her, "Please type the following magic keystrokes and send me the resulting log file." That log file contains a record of what she did.

Usability analysts

Appropriate trace messages can be used to record which features are most used, and how they're used.

Testers

Testers often want to know what's going on "under the hood" as they test a system. Skilled testers watch for oddities and escalate them into important bugs. Information printed in trace statements can help such testers. Trace statements can also help a tester know if a test is really doing what was intended.

Server administrators

If your company operates a server, Trace.java can be used to add important information to the server log.


Features


Outline

This guide has four more sections.

  1. Background material and definitions. There are links from the other sections to terms defined here. You may be able to skip this section, except for the first part. It shows what a trace message looks like.

  2. Information for people adding tracing to complete systems. How is the trace system initialized? How is it controlled?

  3. Information to help programmers with their code. Given that someone has done the work in section 2, how does everyone else use tracing?

  4. Examples help those people who prefer to learn by looking at working code.

Other documentation

I have also written some patterns that describe typical uses of this code. They are, for the most part, less concrete than what you'll find here.

The mailing list is at www.egroups.com/group/Trace-java. You can subscribe by sending mail to Trace-java-subscribe@egroups.com.

Credits

I first wrote this code at Electric Communities. My version was based on an earlier one by Eric Messick. Mark Miller, Bill Franz, and others unknown have made additions.


Introduction

Definitions

System Setup

Adding Tracing

Examples

Copyright © 2000 by Brian Marick. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, draft v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub).

Please send comments on this document to marick@visibleworkings.com.