classwork.ppIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers Classes hierarchy graph
|
Class ALoggingObject
Unit
classwork
Declaration
type ALoggingObject = class(APrintingObject)
Description
This class represents a generic object that is capable of logging items to a given log. The base class does not create a log itself; it relies on the implementations of its descendants to do that. It does provide several utility methods that can be called by descendant implementations in order to log notes, hints, warnings, errors, and fatal errors.
Hierarchy
Overview
Fields
Methods
Description
Fields
|
MyLog: ALog; |
Refers to the log used by the instance to record status information and errors.
|
Methods
|
function init: boolean; override; |
Initializer
|
|
function log(const items: array of const): TStreamIOSize; virtual; |
Log the specified items to the log. This method is simply a pass-through method for ALog.print.
|
|
function logNoteBecause(const message: string; const params: array of const; const retain: boolean = false): ALoggedNote; virtual; |
Log a note to the log.
This method constructs an instance of ALoggedNote, which is then logged. message and params are passed to the constructor for ALoggedNote.
If retain is True , then the instance of ALoggedNote constructed by this routine is returned to the caller; this allows the caller to both log the note and raise it as an exception with one statement:
raise Self.logNoteBecause(noteExecutionReachedHere, []);
Otherwise, the note is freed and the call returns Nil .
|
|
function logHintBecause(const message: string; const params: array of const; const retain: boolean = false): ALoggedHint; virtual; |
Log a hint to the log.
This method constructs an instance of ALoggedHint, which is then logged. message and params are passed to the constructor for ALoggedHint.
If retain is True , then the instance of ALoggedHint constructed by this routine is returned to the caller; this allows the caller to both log the hint and raise it as an exception with one statement:
raise Self.logHintBecause(hintExecutionReachedHere, []);
Otherwise, the hint is freed and the call returns Nil .
|
|
function logWarningBecause(const message: string; const params: array of const; const retain: boolean = false): ALoggedWarning; virtual; |
Log a warning to the log.
This method constructs an instance of ALoggedWarning, which is then logged. message and params are passed to the constructor for ALoggedWarning.
If retain is True , then the instance of ALoggedWarning constructed by this routine is returned to the caller; this allows the caller to both log the warning and raise it as an exception with one statement:
raise Self.logWarningBecause(warnExecutionReachedHere, []);
Otherwise, the warning is freed and the call returns Nil .
|
|
function logErrorBecause(const message: string; const params: array of const; const retain: boolean = false): ALoggedError; virtual; |
Log an error to the log.
This method constructs an instance of ALoggedError, which is then logged. message and params are passed to the constructor for ALoggedError.
If retain is True , then the instance of ALoggedError constructed by this routine is returned to the caller; this allows the caller to both log the error and raise it as an exception with one statement:
raise Self.logErrorBecause(errExecutionReachedHere, []);
Otherwise, the error is freed and the call returns Nil .
|
|
function logFatalErrorBecause(const message: string; const params: array of const; const retain: boolean = false): ALoggedFatalError; virtual; |
Log a fatal error to the log.
This method constructs an instance of ALoggedFatalError, which is then logged. message and params are passed to the constructor for ALoggedFatalError.
If retain is True , then the instance of ALoggedFatalError constructed by this routine is returned to the caller; this allows the caller to both log the error and raise it as an exception with one statement:
raise Self.logFatalErrorBecause(ferrExecutionReachedHere, []);
Otherwise, the error is freed and the call returns Nil .
|
|
function Log: ALog; virtual; |
Retrieve a reference to the log used by the instance to log status messages and warnings. The caller should NOT attempt to free this reference.
|
Generated by PasDoc 0.13.0 on 2015-06-23 19:40:11
|