Syntax
define external function log-message
value stream message-text
class value stream class-value optional initial {""}
severity value counter severity-value optional initial {0}
as log_message in function-library #builtin
Purpose
This function is meant to be used as a general mechanism for error and status logging.
log-message delivers the error or status message passed to it to whatever logging mechanism is being used by the OmniMark run-time. In OmniMark CI or LE, this can be simply writing the message to the "-log" stream. In OmniMark SI, the message may be stamped with additional information, such as the current time and machine/process identity, and sent to another machine or filed in a database.
log-message is useful in batch environments, both because it gives access to the "-log" stream, and because it is invoked in a uniform manner in a server environment. It is useful in server environments because it provides a consistent interface to what can be a variety of message processing systems.
Arguments:
- message-text -- the text of the message.
- severity-value -- this is a counter value that indicates the severity or class of the logged message. Note that this is only used for the OmniMark SI Interpreter with network logging. Unless otherwise defined, the log message routines will display the following values:
- 0 as "WARNING"
- 1 as "ERROR" (recoverable)
- 2 as "SEVERE ERROR" (non-recoverable)
- 3 as "INTERNAL ERROR"
- class-value -- the text of a user-defined category in which to place the logged message. Note that this is used only for the OmniMark SI Interpreter with network logging. Messages from different categories can be interpreted in different ways, or the category can be used to identify the message. An example of a user-defined category is "ODBC" for messages originating from an ODBC database interface. For OmniMark and markup parser messages, the category is "OmniMark", "SGML", etc. User-defined categories are marked as such by this function so that no confusion occurs between user-defined and system-defined categories.
|