Cascade TextLogger: Version 4.0
Prev |  | Next

# log

log -- Writes point data in formatted lines.

## Syntax

    (log label format point [point ...])

## Arguments

`label`

  A name that uniquely identifies this log.

`format`

  A string that includes formatting directives, similar to the kind used in the C language `printf` statement, as follows:

  `%[di]` | Integer.
  `%[xX]` | Hexadecimal integer.
  `%o` | Octal integer.
  `%u` | Unsigned integer.
  `%c` | Single character ASCII representation from integer.
  `%f` | Floating point, decimal.
  `%[eE]` | Floating point, engineering representation.
  `%[gG]` | Floating point, shortest representation of `f` or `e`.
  `%s` | String.

  The above format directives may optionally include the following modifiers between the `%` sign and the format character:

  `-` | Left justify within a field.
  `n` | A number that specifies field width and decimal accuracy.
  `0` | Zero-pad the number to a fixed width.
  `+` | Always include a sign, even if positive.

  The following formats produce output, but are not associated with a point in the argument list:

  `%t` | A time string as defined by the command time.
  `%A` | The global default time spec, as set by the command time.
  `%F` | The default file name for this line, or the global prefix. If the Cascade TextLogger is started with the `-p` option, this command is overridden by the global prefix name.

`point`

  The name of the data point that is to be logged.

## Description

The log command specifies which points to log, and the format of each line of the written output.

## See Also

time

## Example

These logs:

        (log temp "%t Temperatures 31-34: %+04g %+04g %+04g %+04g" tmp31 tmp32 tmp33 tmp34)
        (log press "%t Pressures 31-33: %g %g %g" pr31 pr32 pr39)
        (log max_ht "%t Top: %f" max_ht)
        (log min_ht "%t Bottom: %f" min_ht)
        (log smm32 "%t Summary 32: %+g %02g %f %f" tmp32 pr32 max_ht min_ht)
        (collect any)
        (collect all smm32)

would produce this kind of output:

        ...

        12:03:0973 Bottom: 12.954260
        12:03:0973 Summary 32: +63 5044 24.345670 12.954260
        12:03:0955 Pressures 31-33:  *  5044  *
        12:03:0970 Temperatures 31-34:  *   *  +059  *
        12:03:0976 Pressures 31-33:  *  5046  *
        12:03:0979 Temperatures 31-34:  *  +064  *   *
        12:03:0987 Top: 24.345620
        12:03:0984 Temperatures 31-34: +054  *   *   *
        12:03:0993 Bottom: 12.954210
        12:03:0993 Summary 32: +64 5046 24.345620 12.954210
        12:03:0990 Temperatures 31-34:  *   *  +058  *
        12:03:0981 Pressures 31-33: 5127  *   *
        ...

Prev | Home | Next
group | Up | output

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.