-
Notifications
You must be signed in to change notification settings - Fork 9
Home
Michael Justin edited this page Feb 3, 2016
·
25 revisions
To register a specific logging framework, just add one of the djLogOver... units to the project.
-
djLogOverSimpleLogger
-
djLogOverNOPLogger
-
djLogOverLog4D
program Test; interface uses djLogOverSimpleLogger, // registers the 'simple' logger implementation UnitA, ... ...; begin ... end.
unit UnitA;
interface
uses
...
djLogAPI, djLoggerFactory;
type
TMyMainClass = class(TObject)
private
Logger: ILogger;
...
public
constructor Create;
...
end;
...
constructor TMyMainClass.Create;
begin
inherited;
Logger := TdjLoggerFactory.GetLogger('main.Logger');
Logger.Trace('Creating instance of TMyMainClass.');
...
end;
Log output:
42 TRACE main.Logger - Creating instance of TMyMainClass.