PTC ALD in Arbortext Styler > Components of Documents and Templates > Logging > Logs Generated by PTC Arbortext Layout Developer
Logs Generated by PTC Arbortext Layout Developer
PTC Arbortext Layout Developer generates a large amount information which is output to multiple logs when necessary. PTC Arbortext Layout Developer also provides logs that the template designer can use for their own purposes. PTC Arbortext Layout Developer uses logs to record and report formatting errors, JavaScript errors, and debugging statements.
The Formatting Object Model (FOM) represents logs with the fLog object, an Application object. The logs used by PTC Arbortext Layout Developer are listed as an array on the fApplication.logs property. This array also provides access to the logs for writing messages or redirecting output.
The logs PTC Arbortext Layout Developer has running are listed on the fLog.LogNumber constant. The logs numbered from 5 to 8 are available for use by template designers. Refer to Creating a Log Entry for information. The other logs are reserved for PTC Arbortext Layout Developer’s processes, but some can be written to if required, for example fLog.LOG_BFERR.
The fLog.type property indicates the type of log to which information is written. The different types of log output location are listed on the fLog.LogType constant and include:
fLog.LOG_FILE — creates a file on the file system
fLog.LOG_STREAM — creates a log in an PTC Arbortext Layout Developer text stream tag (.tx)
fLog.LOG_VARIABLE — writes the log in to an PTC Arbortext Layout Developer global variable
fLog.LOG_SYSTEM — writes the log in to a pop-up window, such as that used by the fApplication.alert() method
The other log types should not be used.
The fLog object has a number of methods which allow users to manage and write information to logs: — opens the current log as a specified type
If the log type requires a location path, tag name, or variable name this should be provided when opening the log. Opening a log clears its content. To keep a log open during processing, open it with the first message then use the fLog.isOpen property to test if the log is currently open before writing a new message.
fLog.close — closes the current log and stops any new messages being written to it
fLog.default() — opens and closes the log, resetting it
fLog.write() — writes the argument text to the log
fLog.logMsg() — writes the argument text to the log as a date-stamped message followed by a carriage return
In the PTC Arbortext Layout Developer— Desktop product, logs 0, 1, and 3 are open by default. 0 writes to the alert pop-up, 1 writes to PTC Arbortext Layout Developer’s serrlog.3ad file and 3 writes to the Windows debugging system.
In Arbortext Styler, logs 0, 1, 14, 15, and 16 are open. Log 0 writes to the alert box, 3 writes to the Windows debugging system, and the others record Arbortext Styler events. Log 1 can be used in Arbortext Styler to write information to the event log.
Do not open or close the logs listed here.