Log

Module for logging to Streams.

Initially no stream is present and must be added after creation of class.

Logging to a stream is dependent on the logging level associated with the stream. The levels is in accending order:

  • DEBUG

  • INFO

  • WARN

  • ERROR

  • FATAL

Logging to the stream will only be done for the associated level and higher levels.

Const

DEBUG*  = Const.DEBUG;
INFO*   = Const.INFO;
WARN*   = Const.WARN;
ERROR*  = Const.ERROR;
FATAL*  = Const.FATAL;

Vars

fh : ADTStream.MemoryStream;
logstreams : ARRAY LOGSIZE OF LogStream;
logs : SHORTINT;

Procedures

Debug

DEBUG level logging.

Reference to Format for formatting options.

PROCEDURE Debug*(fmt- : ARRAY OF CHAR; SEQ seq: SYSTEM.BYTE);

Info

INFO level logging.

Reference to Format for formatting options.

PROCEDURE Info*(fmt- : ARRAY OF CHAR; SEQ seq: SYSTEM.BYTE);

Warn

WARN level logging.

Reference to Format for formatting options.

PROCEDURE Warn*(fmt- : ARRAY OF CHAR; SEQ seq: SYSTEM.BYTE);

Error

ERROR level logging.

Reference to Format for formatting options.

PROCEDURE Error*(fmt- : ARRAY OF CHAR; SEQ seq: SYSTEM.BYTE);

Fatal

FATAL level logging.

Reference to Format for formatting options.

PROCEDURE Fatal*(fmt- : ARRAY OF CHAR; SEQ seq: SYSTEM.BYTE);

AddStream

Add a stream object to the list of stream to log to. Up to 16 streams can be added. The logging will be done for the defined level (default to ERROR) and higher levels.

PROCEDURE AddStream*(stream : Object.Stream; level := ERROR : SHORTINT) : BOOLEAN;