THotLog

[ Home ]



Quickstart

 

In order to make your life easier, the unit HotLog.pas declares an instance of THotLog, and calls its constructor automatically, as soon as your programm is loaded (in fact, as soon as the HotLog unit's part of your programm is loaded).

This instance is called "hLog". It is the object instance you'll use to access HotLog.pas/THotLog properties and routines.

All the following examples will allways use it. However, and as stated before, THotLog being an object, you can declare as many instances of it as you want.

 

To use THotLog you will have to:

1. Extract / copy HotLog.pas into the directory of your application.

2. Add "Hotlog" to the uses clauses of your project file (.dpr for Delphi or .lpr for Lazarus) and of all units that may use THotLog:

Uses {...}, HotLog;

3. Somewhere in your application creation scenario, add a call to the StartLogging methode of THotLog instance. A good place example would be in the form create event handler:
procedure TForm1.FormCreate(Sender: TObject);
begin
  ...
  hLog.StartLogging;                          // THotLog's threads are now created and running. You can start logging data.
  ...
end;
Remember that you don't have to instanciate hLog (using its constructor, "Create"), because the instance hLog already exists.

Also remember that you don't need this step if the first logging procedure is a hLog.Add... one. hLog.Add... calls hLog.StartLogging internally if needed.


4. You can now start logging data, using one the provided methodes, like

hLog.Add(aString: String);                    //hLog.Add( ) overloaded procedures imply parsing.
hLog.Add(aStringList: 
TStringList);
hLog.Add(aConstArray : Array of Const);
hLog.AddStr(aString: String);                 //hLog.AddStr( ) avoids parsing.

 

The next pages explain how to change some or all of the hLog default behaviour and values.