Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
CompilerLogs


NAME

CompilerLogs - provide log about loading and compilation processes

SYNOPSIS

TYPE Log = POINTER TO LogRec;
TYPE LogRec = RECORD (Disciplines.ObjectRec) END;


PROCEDURE Create(VAR log: Log; s: Streams.Stream);

PROCEDURE Open(log: Log; loglevel: INTEGER; VAR s: Streams.Stream) : BOOLEAN;

PROCEDURE SetLogLevel(log: Log; maxlevel: INTEGER); PROCEDURE SetMaximalNestLevel(log: Log; maxnestlevel: INTEGER); PROCEDURE Flatten(log: Log); PROCEDURE EnterLevel(log: Log; VAR key: INTEGER); PROCEDURE LeaveLevel(log: Log; key: INTEGER);

PROCEDURE LogLevel(log: Log) : INTEGER; PROCEDURE NestLevel(log: Log) : INTEGER;

DESCRIPTION

CompilerLogs provides a filter and formatting tool for logs about loading and compilation processes. Filtering and formatting depends on two state variables belonging to each log:

Create creates a log that emits its output onto s. The output stream should be line buffered to avoid any delays in seeing log messages.

Generating Logs

Log messages by the compiler or loader are created using Open. The log level of a log message must be positive and Open returns FALSE if this message is to be suppressed by the current filtering rules. No more than one log message stream returned by Open for a particular log must be open at any time to avoid mixups of different log messages.

The current nesting level is increased by EnterLevel and decreased by LeaveLevel. To assure proper nesting a key must be given to LeaveLevel that was previously returned by EnterLevel.

Filtering Logs

SetLogLevel allows to set the current log level. All log messages with a log level larger than maxlevel will be suppressed. A maxlevel of 0 causes all messages to be dropped, a maxlevel of -1 asks for all messages regardless of their log level.

SetMaximalNestLevel requests all log messages to be suppressed with a nesting level larger than maxnestlevel. A maxnestlevel of -1 removes restrictions regarding the nest level. This is the default setting.

By default, CompilerLogs intends its output according to the nest level of the individual log messages. Flatten suppresses any indentation and sets the maximal nesting level to -1 (unrestricted).

LogLevel and NestLevel return the current log and nesting level, respectively.

DIAGNOSTICS

CompilerLogs does not generate any error events on its own.

SEE ALSO

obload
command line interface for ObjectLoader that allows a log level to be specified.
CompilerErrors
standardized events for compilation errors that are usually not distributed by logs.
ObjectLoader
general object loader for compiler databases, currently the main source of log messages from loading processes.

Edited by: borchert, last change: 2003/07/10, revision: 1.3, converted to HTML: 2003/07/10

Oberon || Library || Module Index || Search Engine || Definition || Module