output

output — writes an output string to a log or group, a file, stdout, or stderr.

Syntax

(output mode string [string ...])
    

Arguments

mode

Specifies where the output string is to be written. One of the following options:

label

Write the string to the corresponding log, or all the logs in the group.

filename

Write the string to the corresponding file.

stdout

Write the string to standard output.

stderr

Write the string to standard error.

string

A string to be inserted into the output.

Returns

On success, t, otherwise one of the following error messages:

(error "textlog: No file filename for output command")
(error "textlog: Too many arguments to output: # < #")
(error "textlog: Invalid command: output")

or, if none of the above errors apply, nil.

Description

The output command inserts an output string into a file, one or more logs, standard output, or standard error, as a line. If the label is for a single log, the string will appear in that log only. If the label is for a group, then the string will appear in each of the logs pertaining to that group.

This command corresponds to the Cogent C API function LG_Output.

See Also

file, group, log

Example

(output press "Pressure recorded on %M %j, %Y,"
              " starting at %02h:%02n:%02z.%T")
(output stdout "Starting log now ...")