THotLog

[Home]



HLog general setup

These functions must be called before calling hLog.StartLogging or any hLog.Add methode.


Procedure SetErrorCaption(value: String; surroundChar: String; jumpLines: Boolean=True);

"value" is a string property used to prefetch error lines. (Error lines are the one outputed using THotLog.AddException() and THotLog.AddError() methodes.) "value" will be used unchanged.
"surroundChar" will be duplicated up to the length of "value", or up to at least 80 chars, depending on errorViewStyle (see below: SetErrorViewStyle).
If a surrond char is provided, this "surronding string" will be added before and after the error line.

(See hLog.AddException to view examples of outputs depending on the parameters above)


Procedure SetErrorViewStyle(value: TVarRecStyle);

TVarRecStyle = (vsNone, vsBasic, vsExtended);
When set to vsBasic, the arguments passed to hLog error logging methodes will be outputed in one line, surrounded by parenthesis, and separated by a comma.
When set to vsExtended, the arguments will be formatted and outputed, one by line, in such a way to give as much details as possible on each.

(vsNone should not be used there. It is used in the overloaded version of THotLog.Add( ), which deals with arrays of const.

(See hLog.AddException to view examples of outputs depending on viewStyle)


Procedure SetRulerLength(newLength: Integer);

THotLog can output a ruler on one or two lines.
It was usefull at design time, and can still be, so I left it. It's default length is 80 bytes, and can be set up to ten thousand.

The ruler will be outputed when you'll pass the ruler tag to a parsing function.


Function ModifyLineNumbering(doShow: Boolean; alignment: TAlignment=taRightJustify; size: Integer=3): Boolean;

THotLog maintains a line count, and can show line numbers.

If DoShow = True, lines numbers are displayed,
alignment can be alLeft or alRight (center is ignored...).
size is the number of characters you want the line numbers to be aligned to. Line numbers are followed by a space.

Line numbers will typically be added at the begining of any line, aligned right, on 3 positions (size:=3) , padded with space(s), and followed by one more space.

Line numbers are NOT displayed by default. The hlParser constructor sets line numbering fields to:
(doShow: False; alignment: taRightJustify; size:3);

Line counting is allways maintained, be line numbers displayed or not.

If the line number representation grows above "size" (for example if you did set size to 3 and your log reaches 1000 lines (!), then the size parameter is ignored (unless you change it for something bigger).

Line numbering is a global parameter, that can be temporarily overrided by the use of the line numbering tag.