Index

log $datatype(expr) | $function(args) | $variable | "string", ...

Record a message in the log file and send it to control clients.

Arguments:
argument
A value to be logged. This can have any one of the following forms:
  • $datatype(expression)
    Where datatype is the name of a datatype, and expression is an expression of that type.
  • $function(args)
    Where function is the name of any function and args are its arguments.
  • $variable
    Where variable is the name of a scalar variable. If this is an aggregate type then it must be followed by a valid field selection expression that refers to a scalar member of the aggregate, or that of a sub-aggregate.
  • "string"
    Where "string" is an ASCII string, optionally containing C-style escape sequences.

Example:
The following example logs the start of each new source.
 foreach(Source s) {3c345, 3c273, 0552+398} {
   log "Starting observation of ", $s, " at ", $time(UTC), "."
   track $s
   until $elapsed > 1m
 }
Context:
The log command is used to record messages in the log. If a log file is open then the messages will be recorded there. They are also sent to be displayed in the log window of any connected cbiviewer programs.

Note that unlike the similar print command, the log behaves the same regardless of whether it is used interactively or in a script.


Martin Shepherd (26-Feb-1999)