LoggerPro (1.0)A simple, pluggable and modern logging framework for Delphi
Unit LoggerPro
Description
Uses
- System.Generics.Collections
- System.SysUtils
- System.Classes
Overview
Classes, Interfaces, Objects and Records
Functions and Procedures
Types
Variables
Description
Functions and Procedures
function BuildLogWriter(aAppenders: array of ILogAppender; aEventsHandlers: TLoggerProEventsHandler = nil; aLogLevel: TLogType = TLogType.Debug): ILogWriter; |
Builds a new ILogWriter instance. Call this global function to start logging like a pro.
Here's a sample unit that you can use in your code
unit LoggerProConfig;
interface
uses
LoggerPro;
function Log: ILogWriter;
implementation
uses
LoggerPro.FileAppender;
var
_Log: ILogWriter;
function Log: ILogWriter;
begin
Result := _Log;
end;
initialization
_Log := BuildLogWriter([TLoggerProFileAppender.Create(10, 5)]);
end.
Add this unit to your project, then when you need to use the logger, include the unit and call one of the followings:
Log.Debug('This is a debug message', 'tag1')
Log.Info('This is an information message', 'tag1')
Log.Warn('This is a warning message', 'tag1')
Log.Error('This is an error message', 'tag1')
|
Types
TLogType = (...); |
Values
-
Debug = 0:
-
Info:
-
Warning:
-
Error:
|
TLogErrorReason = (...); |
Values
|
TLogErrorAction = (...); |
Values
|
Variables
DefaultLoggerProMainQueueSize: Cardinal = 100000; |
|
DefaultLoggerProAppenderQueueSize: Cardinal = 10000; |
|
Copyright 2016 Daniele Teti
Generated by PasDoc 0.14.0.
|