logwrite
Description
Writes items to a specific log.
|
Any attempts to write to a log that has not been opened first will be ignored
|
Example 41. Log messages and display log content to the windows system
This example, using inline PIs, will write the words `hello' and 'world" to the log number 7 (LOG7), then display the content of LOG7 to a windows system pop up box:
The quick <?logwrite LOG7 hello> brown fox <?logwrite LOG7
world> jumps over a <?logopen LOG7 SYSTEM> lazy dog.
Putting an <?logclose> at the end of the line would close the log, thus preventing any more writing to it.
Syntax
logwrite logspec:n text:t
logspec
|
The log number:
LOG0
|
Log number 0 (Alias of BFOUT (0))
|
LOG1
|
Log number 1 (Alias of BFERR (1))
|
LOG2
|
Log number 2 (Alias of BFDBG (2))
|
LOG3
|
Log number 3 (Alias of BFODS (3))
|
LOG4
|
Log number 4 (Alias of BFLOG (4))
|
LOG5
|
User Log number 5
|
LOG6
|
User Log number 6
|
LOG7
|
User Log number 7
|
LOG8
|
User Log number 8
|
LOG9
|
User Log number 9
|
SYSTEM
|
Write the contents of log to a predetermined SYSTEM pop up box.
|
ODS
|
Use Windows specific Output Display System messages.
|
|
text
|
The name of the tag containing the text, information or message to be written to the log
|
Sample macros
logwrite LOG5 Hello, this is my sample log message: write the text “Hello, this is my sample log message” to log 5 if it has been opened.
Additional Information
The logwrite macro is identical in function to its processing instruction equivalent. Its purpose is to allow logs to be controlled through a script instead of within a formatting operation. The use of the macro is completely interchangeable with the PI so, for example, it is possible to open a log using the <?logopen> PI, and write to it via the logwrite macro detailed here.
Related Links