Example

Cascade TextLogger: Version 4.0
Prev | Chapter 2. Using the Cascade TextLogger | Next

# 2.5. Example

Here is an example of a configuration file and four files generated from it. Notice that the files `press.txt` and `tanks.txt` have empty data points in them. This is because the collect command specified a global default of `any`. The other two files show the effects of collect using `all` and `fill`.

The first line in each output file shows the values of all the requested points before the Cascade TextLogger was started, at the time of the most recent change.

    (usegmt f)
    (time "%02h:%02n:%02z%02H")
    (timestamp last)
    (collect any)
    (tolerance 0 10000005)
    (empty " * ")

    (log temps "%t Tank: %3d %3d %3d  Burner: %3d %3d %3d" t1 t2 t3 t4 t5 t6)
    (log pressures "%t Pressures: %3d %3d %3d" p1 p2 p3)
    (log levels "%t Levels: %d %d %d" l1 l2 l3)
    (log tanks "%t Tank 1: %3d %3d %3d  Tank 2: %3d %3d %3d  Tank 3: %3d %3d %3d"
                t1 p1 l1 t2 p2 l2 t3 p3 l3)

    (collect all temps)
    (collect fill levels)

    (file temps.txt temps)
    (file press.txt pressures)
    (file levels.txt levels)
    (file tanks.txt tanks)

    (output stdout "Started logging...")
    (output temps.txt "Temperature readings for %M %j, %Y:")
    (output temps.txt "                  t1  t2  t3"
                      "           t4  t5  t6")
    (output press.txt "Pressure readings for %M %j, %Y:")
    (output press.txt "                      p1  p2  p3")
    (output levels.txt "Level readings for %M %j, %Y:")
    (output levels.txt "                   l1  l2  l3")
    (output tanks.txt "Tank readings for %M %j, %Y:")
    (output tanks.txt "                    t1 p1  l1"
                      "            t2 p2  l2"
                      "            t3 p3  l3")

### Output to `temps.txt`:

    Temperature readings for Oct 12, 2000:
                      t1  t2  t3           t4  t5  t6
    14:26:3235 Tank:  11  21  31  Burner:  41  51  61
    14:44:5546 Tank:  10  20  30  Burner:  40  50  60
    14:44:5577 Tank:  11  21  31  Burner:  41  51  61

### Output to `press.txt`:

    Pressure readings for Oct 12, 2000:
                          p1  p2  p3
    14:26:3238 Pressures: 311 320 335
    14:44:5531 Pressures: 313  *   *
    14:44:5555 Pressures:  *  322  *
    14:44:5558 Pressures:  *   *  330
    14:44:5563 Pressures: 311  *   *
    14:44:5572 Pressures:  *  320  *

### Output to `levels.txt`:

    Level readings for Oct 12, 2000:
                       l1  l2  l3
    14:26:3245 Levels: 611 621 631
    14:44:5548 Levels: 610 621 631
    14:44:5550 Levels: 610 620 631
    14:44:5553 Levels: 610 620 630
    14:44:5582 Levels: 611 620 630
    14:44:5584 Levels: 611 621 630

### Output to `tanks.txt`:

    Tank readings for Oct 12, 2000:
                        t1 p1  l1            t2 p2  l2            t3 p3  l3
    14:26:3245 Tank 1:  11 311 611  Tank 2:  21 320 621  Tank 3:  31 335 631
    14:44:5531 Tank 1:  *  313  *   Tank 2:  *   *   *   Tank 3:  *   *   *
    14:44:5534 Tank 1:  10  *   *   Tank 2:  *   *   *   Tank 3:  *   *   *
    14:44:5536 Tank 1:  *   *   *   Tank 2:  20  *   *   Tank 3:  *   *   *
    14:44:5538 Tank 1:  *   *   *   Tank 2:  *   *   *   Tank 3:  30  *   *
    14:44:5548 Tank 1:  *   *  610  Tank 2:  *   *   *   Tank 3:  *   *   *
    14:44:5550 Tank 1:  *   *   *   Tank 2:  *   *  620  Tank 3:  *   *   *
    14:44:5553 Tank 1:  *   *   *   Tank 2:  *   *   *   Tank 3:  *   *  630
    14:44:5555 Tank 1:  *   *   *   Tank 2:  *  322  *   Tank 3:  *   *   *
    14:44:5558 Tank 1:  *   *   *   Tank 2:  *   *   *   Tank 3:  *  330  *
    14:44:5560 Tank 1:  11  *   *   Tank 2:  *   *   *   Tank 3:  *   *   *
    14:44:5563 Tank 1:  *  311  *   Tank 2:  *   *   *   Tank 3:  *   *   *
    14:44:5565 Tank 1:  *   *   *   Tank 2:  21  *   *   Tank 3:  *   *   *
    14:44:5567 Tank 1:  *   *   *   Tank 2:  *   *   *   Tank 3:  31  *   *
    14:44:5572 Tank 1:  *   *   *   Tank 2:  *  320  *   Tank 3:  *   *   *
    14:44:5580 Tank 1:  *   *   *   Tank 2:  *   *   *   Tank 3:  *  335  *
    14:44:5582 Tank 1:  *   *  611  Tank 2:  *   *   *   Tank 3:  *   *   *
    14:44:5584 Tank 1:  *   *   *   Tank 2:  *   *  621  Tank 3:  *   *   *

Prev | Home | Next
Logs, Groups, and Labels | Up | Commands

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