Macro Language Reference > PIs > Text > <?logwrite>
  
<?logwrite>
Description
The <?logwrite> command instructs PTC ALD to write items to a specific log.
 
Example 477. 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:b text:s>
logspec
The log location or log instance to which to write.
The log locations detailed below will write log messages to predetermined locations:
SYSTEM
Windows: output to a Windows Message Box
UNIX/Linux: output to stdout
ODS
Windows only : output to the Windows System Debugger
There are 10 log instances that can be used. 0-4 are pre-opened by PTC ALD and default to system log locations, 5-9 are left unopened for use in templates. They can all be selected and written to user-specified locations, variables, streams etc.:
LOG0
Log number 0 (default log location: BFOUT LOG0 SYSTEM)
LOG1
Log number 1 (default log location: BFERR LOG1 {@}serrlog.3at )
LOG2
Log number 2 (default log location: BFDBG LOG2 3B2 debug file, or BFERR if no debug file specified)
LOG3
Log number 3 (default log location: BFODS LOG3 ODS)
LOG4
Log number 4 (default log location: BFLOG LOG4 None)
LOG5
User Log number 5 (default log location: None)
LOG6
User Log number 6 (default log location: None)
LOG7
User Log number 7 (default log location: None)
LOG8
User Log number 8 (default log location: None)
LOG9
User Log number 9 (default log location: None)
text
Text, information or message to be written to the log.
Additional Information
The <?logwrite> processing instruction is identical in function to its macro equivalent. Its purpose is to allow logs to be controlled within a formatting operation instead of through a script. The use of the processing instruction is completely interchangeable with the macro so, for example, it is possible to open a log using the logopen macro, and write to it via the <?logwrite> PI detailed here.
Related Links