file

file — specifies the file to receive a log.

Syntax

(file filename [label ...])
    

Arguments

filename

One of the following:

    The name of the file that will be logged to.

    stdout

    stderr

label

An optional log or group label.

Returns

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

(error "textlog: Could not open output file filename: reason")
(error "textlog: Could not set line buffering on file filename: reason")
(error "textlog: Group or log label does not exist")
(error "textlog: Too few arguments to filename: # < #")
(error "textlog: Invalid command: filename")

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

Description

The file command lets you specify the filename that a log or group will be written to. If no label is specified, this command sets a global default value for all logs and groups. Any specific value always overrides the global definition, regardless of the order in the configuration file or when a command is sent.

If this command specifies multiple labels, the logs for all of those labels will be written to one file. They will not necessarily always be written in exact time-sequential order, however. You may have to post-process the file if you need that kind of record.

[Note]

The Cascade TextLogger writes each log only once. If you apply the file command twice for the same log, writing to a different file each time, for example, only the most recent application of file will produce results. Thus, if you need the same information written in two places, make two identical logs with different labels.

This command corresponds to the Cogent C API function LG_File.

See Also

log

Example

(file reports/r2335.txt press temp)
(file stdout max_ht)