Specifications
DescriptionDisplay typeNumeric type
A formal message that marks the completion of a task for which
a start message was previously issued
End6
An informational message solely intended for debugging purposesDebug-1
A message solely intended for debugging purposes that is issued
only when a coding error is discovered
Assert-2
Log Message
The message argument and the optional extra argument specify the message being issued, as a
constant and variable part. For example:
e.log(2, "Trial period will expire in %1 days", days);
The message argument should be a constant string (that is, not constructed programmatically)
because it is used as a key in the localization database. The “extra” argument, when present,
replaces the placeholder “%1” in the localized version of the message. If the “extra” argument
is missing or null, no replacement takes place.
If the extra argument is a number, it is rounded to the nearest integer and then converted to
the corresponding decimal string representation. This allows picking alternative messages from
the localization database depending on the number (example: “1 day” versus “2 days”).
If the extra argument is a string, all leading and trailing white space is removed, and any
remaining line breaks (CR, LF, or CRLF) are replaced by a semicolon. This allows passing multi-line
text (such as the complete contents of stderr or stdout) to the extra argument without
inadvertently causing line breaks in log messages.
Log: Multiple variable parts
The message argument can use the special placeholders “%11”, “%12” through “%19” to access
the corresponding segment (indexed 1 through 9) of the extra argument interpreted as a list of
comma-separated values. If the specified segment does not exist the empty string is used. There
is no support for quoted strings so individual values in the list can not contain commas.
Log: Showing progress
The messages of type "start", "progress" and "end" cause a task to be displayed in the Progress
pane. The extra argument (which must be an integer) is used to indicate the total progress range
and the current progress. For example, to indicate a taskconsisting of twelve more or less equal
parts one might write:
e.log(4, "Task started", 12);
for (var i=0; i < 12; i++)
{
e.log(5, "Task in progress", i);
...
}
e.log(6, "Task ended");
Where possible use the job.log() function instead, because it includes information about the job
in the Progress pane.
450
Enfocus Switch 10










