| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (8 out of 11)

Working With the Operator Logbook

The Operator Logbook is a collection of workspaces that receive error messages from G2's default error handler. The Operator Logbook appears as a set of pages, each of which can contain one or more error and informational messages produced by G2.

The next figure shows one Operator Logbook page. Notice that each page has a header that displays today's date and a page number. Clicking the mouse on one of the two triangles causes G2 to display either the preceding or subsequent Logbook page.



Note: Operator Logbook messages are internal to G2, rather than being posted by the user, and therefore are not included in the values of expressions such as the count of each message.

Hiding and Showing Logbook Pages

The G2-WINDOW class includes the Show-operator-logbook-in-this-window? attribute, whose value is yes (the default) or no. Leaving the value of this attribute as yes causes the Operator Logbook to be displayed as specified in the Logbook Parameters system table.

Changing the attribute value to no for a window hides all existing Operator Logbook pages in that window. Subsequent messages are recorded in the logbook, but all pages remain hidden. Changing the value to yes again shows logbook pages as specified in the Logbook Parameters system table. The pages look as they would if they had never been hidden.

To hide and show operator logbook pages:

For example, the following procedures programmatically show and hide the Operator Logbook pages in the g2-window for the user kmm:


Limiting the Number and Size of Logbook Pages

You can conserve G2's use of memory (specifically, its region 1 memory) by keeping fewer Operator Logbook pages in memory, and by limiting the number of logbook messages allowed per page. The number of Operator Logbook pages can quickly accumulate, because G2 automatically writes a message to the Operator Logbook workspace each time you start, pause, or reset the current KB.

To limit the number of Operator Logbook pages:

To limit the size of Operator Logbook pages:

Navigating to an Item Referenced in an Operator Logbook Message

Each Operator Logbook message that references at least one item in the current KB includes the go to referenced item menu choice. Selecting go to referenced item causes G2 to display the workspace that contains the item referenced in the message, and displays the referenced item (shown within its own workspace) in the center of the window that G2 is displaying.


Note: The go to referenced item menu choice appears only if the Operator Logbook message references an item on a workspace that is not configured to be proprietary. Chapter 47, Package Preparation describes proprietary workspaces.

For example, before selecting go to referenced item, your window might appear like this:


After selecting go to referenced item, G2 displays the referenced action button at the center of the window, as shown in the next figure:


Use the go to referenced item menu choice with care. As shown above, G2 relocates the referenced item's parent workspace so that the item appears at the center of the window. (This might disrupt the visual organization of a KB whose workspaces have been carefully positioned.) G2 also displays that item's parent workspace at its full scale, as described under Scaling a Workspace.


Note: A message placed on the Operator Logbook by an inform action does not display the go to referenced item menu choice.

If you select an Operator Logbook message that references more than one item, the go to referenced item menu choice leads to a submenu, from which you can choose a particular item, as shown in the next figure:


If an Operator Logbook message does not refer to an item, G2 does not offer the go to referenced item menu choice in the message's menu, as shown in the next figure:


Shadowing the Operator Logbook Message Handler

When G2 posts a message to the Operator Logbook, it does so by calling an Operator Logbook message handler and passing it the message. The system-defined handler posts the message to the logbook.

You can shadow the system-defined handler with any procedure that takes one argument of type text. Such a procedure is called a user-defined Operator Logbook message handler. Once registered, such a handler receives all messages that would otherwise go to the system-defined handler and be posted to the Operator Logbook. Such messages do not appear on the logbook, and are not recorded in the log file (if any).

If any activity of a user-defined Operator Logbook message handler causes G2 to post a message to the Operator Logbook, the request goes to the system-defined handler, which posts the message as if no user-defined handler had been registered.

Resetting G2 does not affect handler shadowing: any handler registered remains in effect when G2 restarts.


Note: The following procedures provide low-level operator logbook message handling. More sophisticated techniques are available through GFR. See the G2 Foundation Resources User's Guide for details.

To register a logbook message handler:

To deregister a logbook message handler:

To get the logbook message handler:

Each of these procedures is described in more detail in the G2 System Procedures Reference Manual.

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (8 out of 11)

Copyright © 1997 Gensym Corporation, Inc.