}

STUI:STUI Menu:Log Windows

Log windows display messages from all "actors" (instruments, the TCC, the hub...) and allow you to send commands. Controls along the top allow you to filter out unwanted garbage or highlight messages of particular interest. Logged messages include a TAI timestamp (unlike TUI, which shows a UTC timestamp).

Contents

Filtering Out Unwanted Messages

Filtering allows you to hide the messages you don't want to see.

Press the "Filter:" button to enable filtering. This will show the following filtering controls. The first menu controls severity; all messages with at least this severity are shown. The next control allows you to show selected additional messages.

Common tasks:

  • To be left alone unless things go wrong, set severity to Warnings and ignore everything else.
  • To keep an eye on everything, set severity to Normal. That filters out the debug messages (which are rarely wanted).
  • To watch particular instrument (or other actor), set severity to Warnings, set the next menu to "+ Actor" and pick an actor from the 3rd menu. This will show all messages from that particular actor, plus warnings and error messages from anywhere.

Notes:

Custom Filters

"+ Custom" supports user-defined filters expressed as python lambda expressions: lambda x: test where x is a LogEntry, which is displayed if test evaluates to True. Attributes of a LogEntry include:

  • actor: the actor that sent the message.
  • msgStr: the original message string.
  • severity: -1 = debug, 0 = information, 1 = warning, 2 = error
  • cmdr: the commander name (program.username or program.username.actorstack)
  • cmdID: the command ID number
  • keywords: a low-level representation of keyword-value data; see below for more information.

Examples:

  • Show sop stage state messages (such keywords all end with "State"):
    lambda x: x.actor == "sop" and "State" in x.msgStr
  • Hide most weather data (relies on the fact that a list is True unless it is empty):
    lambda x: x.actor not in ("apo", "tcc", "cmds") or not [i for i in ("wind", "temp", "humid", "pressure") if i in x.msgStr.lower()]
Keywords

The keywords field is low-level representation of keyword-value data in the message. It is tricky to use, but I provided a brief overview here. For more details see the documentation about an opscore.protocols.messages.Keywords and opscore.protocols.messages.Keyword in the Trac wiki; a good place to start is Ops/Parsing.

The keywords field is a collection of Keyword objects. Each Keyword object represents one keyword in the message; it has a name field (the name of the keyword, with the original case, as a string) and a values field (a sequence of 0 or more string values; note that the values have not been validated and so have not been converted to their final type).

  • You can test if a given keyword is present using "in" and the test is not case sensitive. For example a way to only show sop gotoField state messages is as follows (where you can use any case for "gotoFieldState"):
    lambda x: x.actor == "sop" and "gotoFieldState" in x.keywords
  • Use [name] to get a particular keyword (after making sure it is present) and again the name is not case sensitive. For example to only show messages about low temperatures:
    lambda x: "airTemp" in x.keywords and float(x.keywords["airTemp"].values[0]) < -10.0

Finding Text

To find a particular bit of text, type something into the Find: box and hit <return> to search from the most recent message (or the selection, if any), backwards in time. You can also type ctrl-<return> to search forwards.

Notes:

Highlighting Text

Highlighting allows you color-code messages of particular interest. You may also play a sound cue when a highlighted message comes in, which is useful for keeping track of rare occurrances (but potentially maddening for frequent hits). To enable highlighting, press the Highlight: button. This shows the various highlight controls, which I hope are self-explanatory.

Warning: you can only highlight messages you can see! Be sure you aren't filtering out messages you want to hightlight!

Notes:

Regular Expressions

All Filter, Find and Highlight text entry boxes accept regular expressions (just one for Text; a set of space-separated regular expressions for Actors and Commands). These are tcl regular expression, which are very much like python or perl regular expressions.

Sending Commands

To send commands to an actor, type into the bottom field of the window. Normally you type the actor name (all lowercase), a space, and the command (which can be anything the actor understands), followed by <return> to send the command. For example "tcc show time<return>" will return the time from the TCC.

If you plan to send many messages to a particular actor, you may select the actor from the menu next to the command entry field. STUI will then automatically fill in that actor's name for you (though you can change it). Remember that you can also highlight replies from a particular actor or even filter out all other messages. This can be very handy for an intensive session with one instrument.

The command entry area also has command history. Use the up arrow to recall earlier commands; edit as desired and reissue with <return>. (If you issue the same command several times in a row, only the first is stored in the command history.)

Known Issues

If you change the filtering you may lose the oldest data in the log window. (This is because each log window has a finite-sized buffer for data and there is also a central repostory for log data that has its own finite size. Whenever you change the filter all data in the log window is replaced from the repository.)