Squashed 'lib/loggerpro/' changes from 49891138..d490578b

d490578b Update README.md
0dedf956 Added ILogItemRenders

git-subtree-dir: lib/loggerpro
git-subtree-split: d490578b87872f7995c230f48e328e576d0e2ffe
This commit is contained in:
Daniele Teti 2024-01-23 17:20:36 +01:00
parent 8cd1e89f79
commit 88cb06e717
43 changed files with 653 additions and 329 deletions

View File

@ -48,7 +48,7 @@ type
/// </summary>
procedure PrepareMessage(const aLogItem: TLogItem; out aSubject, aBody: String); virtual;
public
constructor Create(aSMTP: TIdSMTP; const aFromAddresses, aToAddresses: String; aLogLayout: string = TLogLayout.LOG_LAYOUT_0); reintroduce;
constructor Create(aSMTP: TIdSMTP; const aFromAddresses, aToAddresses: String; aLogItemRenderer: ILogItemRenderer = nil); reintroduce;
procedure Setup; override;
procedure TearDown; override;
procedure WriteLog(const aLogItem: TLogItem); override;
@ -60,9 +60,9 @@ implementation
uses
System.SysUtils, IdMessage;
constructor TLoggerProEMailAppender.Create(aSMTP: TIdSMTP; const aFromAddresses, aToAddresses: String; aLogLayout: string);
constructor TLoggerProEMailAppender.Create(aSMTP: TIdSMTP; const aFromAddresses, aToAddresses: String; aLogItemRenderer: ILogItemRenderer);
begin
inherited Create(aLogLayout);
inherited Create(aLogItemRenderer);
FSMTP := aSMTP;
FFromAddresses := aFromAddresses;
FToAddresses := aToAddresses;

View File

@ -106,7 +106,7 @@ type
aMaxFileSizeInKiloByte: Integer = TLoggerProFileAppenderBase.DEFAULT_MAX_FILE_SIZE_KB;
aLogsFolder: string = '';
aLogFileNameFormat: string = TLoggerProFileAppenderBase.DEFAULT_FILENAME_FORMAT;
aLogLayout: string = TLogLayout.LOG_LAYOUT_0;
aLogItemRenderer: ILogItemRenderer = nil;
aEncoding: TEncoding = nil);
reintroduce; virtual;
procedure Setup; override;
@ -151,7 +151,7 @@ type
aMaxFileSizeInKiloByte: Integer = TLoggerProFileAppenderBase.DEFAULT_MAX_FILE_SIZE_KB;
aLogsFolder: string = '';
aLogFileNameFormat: string = TLoggerProSimpleFileAppender.DEFAULT_FILENAME_FORMAT;
aLogLayout: string = TLogLayout.LOG_LAYOUT_0;
aLogItemRenderer: ILogItemRenderer = nil;
aEncoding: TEncoding = nil);
override;
end;
@ -312,10 +312,10 @@ constructor TLoggerProFileAppenderBase.Create(
aMaxFileSizeInKiloByte: Integer;
aLogsFolder: string;
aLogFileNameFormat: string;
aLogLayout: string;
aLogItemRenderer: ILogItemRenderer;
aEncoding: TEncoding);
begin
inherited Create(aLogLayout);
inherited Create(aLogItemRenderer);
fLogsFolder := aLogsFolder;
fMaxBackupFileCount:= Max(1, aMaxBackupFileCount);
fMaxFileSizeInKiloByte := aMaxFileSizeInKiloByte;
@ -451,7 +451,8 @@ begin
end;
constructor TLoggerProSimpleFileAppender.Create(aMaxBackupFileCount, aMaxFileSizeInKiloByte: Integer;
aLogsFolder: string; aLogFileNameFormat, aLogLayout: string;
aLogsFolder: string; aLogFileNameFormat: String;
aLogItemRenderer: ILogItemRenderer;
aEncoding: TEncoding);
begin
inherited Create(
@ -459,7 +460,7 @@ begin
aMaxFileSizeInKiloByte,
aLogsFolder,
aLogFileNameFormat,
aLogLayout,
aLogItemRenderer,
aEncoding);
end;

View File

@ -2,7 +2,7 @@
//
// LoggerPro
//
// Copyright (c) 2010-2023 Daniele Teti
// Copyright (c) 2010-2024 Daniele Teti
//
// https://github.com/danieleteti/loggerpro
//
@ -32,8 +32,7 @@ interface
uses
LoggerPro.FileAppender,
System.Classes,
LoggerPro,
System.SysUtils;
LoggerPro, System.SysUtils;
type
{ @abstract(JSONL file appender with multiple tags)
@ -45,7 +44,6 @@ type
procedure EmitStartRotateLogItem(aWriter: TStreamWriter); override;
procedure EmitEndRotateLogItem(aWriter: TStreamWriter); override;
public
function FormatLog(const ALogItem: TLogItem): string; override;
constructor Create(aMaxBackupFileCount: Integer = TLoggerProFileAppender.DEFAULT_MAX_BACKUP_FILE_COUNT;
aMaxFileSizeInKiloByte: Integer = TLoggerProFileAppender.DEFAULT_MAX_FILE_SIZE_KB; aLogsFolder: string = '';
aLogFileNameFormat: string = TLoggerProSimpleFileAppender.DEFAULT_FILENAME_FORMAT; aEncoding: TEncoding = nil);
@ -65,6 +63,18 @@ uses
;
type
TLogItemRendererJSONL = class(TLogItemRenderer)
private
fFormatSettings: TFormatSettings;
protected
// ILogLayoutRenderer
procedure Setup; override;
procedure TearDown; override;
function RenderLogItem(const aLogItem: TLogItem): String; override;
end;
{ TLoggerProJSONLFileAppender }
constructor TLoggerProJSONLFileAppender.Create(
@ -78,7 +88,7 @@ begin
aMaxFileSizeInKiloByte,
aLogsFolder,
aLogFileNameFormat,
TLogLayout.LOG_LAYOUT_0,
TLogItemRendererJSONL.Create,
aEncoding);
end;
@ -92,33 +102,6 @@ begin
// do nothing
end;
function TLoggerProJSONLFileAppender.FormatLog(const ALogItem: TLogItem): string;
var
lJSON: TJsonObject;
begin
lJSON := TJSONObject.Create;
try
{$IF Defined(USE_JDO)}
lJSON.S['type'] := ALogItem.LogTypeAsString;
lJSON.S['message'] := ALogItem.LogMessage;
lJSON.S['tag'] := ALogItem.LogTag;
lJSON.S['ts'] := DateTimeToStr(ALogItem.TimeStamp, Self.FormatSettings).TrimRight;
lJSON.I['tid'] := ALogItem.ThreadID;
{$ELSE}
lJSON.AddPair('type', ALogItem.LogTypeAsString);
lJSON.AddPair('message', ALogItem.LogMessage);
lJSON.AddPair('tag', ALogItem.LogTag);
lJSON.AddPair('ts', DateTimeToStr(ALogItem.TimeStamp, Self.FormatSettings).TrimRight);
lJSON.AddPair('tid', ALogItem.ThreadID);
{$ENDIF}
Result := lJSON.ToJSON;
if Assigned(OnLogRow) then
OnLogRow(ALogItem, Result)
finally
lJSON.Free;
end;
end;
function TLoggerProJSONLFileAppender.GetLogFileName(const aTag: string; const aFileNumber: Integer): string;
var
lOrigFName, lOrigExt: string;
@ -133,5 +116,43 @@ begin
end;
{ TLogItemRendererJSONL }
function TLogItemRendererJSONL.RenderLogItem(const aLogItem: TLogItem): String;
var
lJSON: TJsonObject;
begin
lJSON := TJSONObject.Create;
try
{$IF Defined(USE_JDO)}
lJSON.S['type'] := ALogItem.LogTypeAsString;
lJSON.S['message'] := ALogItem.LogMessage;
lJSON.S['tag'] := ALogItem.LogTag;
lJSON.S['ts'] := DateTimeToStr(ALogItem.TimeStamp, fFormatSettings).TrimRight;
lJSON.I['tid'] := ALogItem.ThreadID;
{$ELSE}
lJSON.AddPair('type', ALogItem.LogTypeAsString);
lJSON.AddPair('message', ALogItem.LogMessage);
lJSON.AddPair('tag', ALogItem.LogTag);
lJSON.AddPair('ts', DateTimeToStr(ALogItem.TimeStamp, fFormatSettings).TrimRight);
lJSON.AddPair('tid', ALogItem.ThreadID);
{$ENDIF}
Result := lJSON.ToJSON;
finally
lJSON.Free;
end;
end;
procedure TLogItemRendererJSONL.Setup;
begin
inherited;
fFormatSettings := GetDefaultFormatSettings;
end;
procedure TLogItemRendererJSONL.TearDown;
begin
inherited;
end;
end.

View File

@ -109,7 +109,7 @@ type
/// creation event is defined </param>
constructor Create(aTopic: string=''; aEphemeral: Boolean = False;
aNSQUrl: string=DEFAULT_NSQ_URL;
aLogFormat: string=TLogLayout.LOG_LAYOUT_0);
aLogItemRenderer: ILogItemRenderer = nil);
reintroduce;
property NSQUrl: string read GetNSQUrl write SetNSQUrl;
property Ephemeral: Boolean read FEphemeral write SetEphemeral;
@ -127,9 +127,9 @@ implementation
uses System.NetEncoding;
constructor TLoggerProNSQAppenderBase.Create(aTopic: string; aEphemeral: Boolean;
aNSQUrl: string; aLogFormat: string);
aNSQUrl: string; aLogItemRenderer: ILogItemRenderer);
begin
inherited Create(aLogFormat);
inherited Create(aLogItemRenderer);
FEphemeral := aEphemeral;
FNSQUrl := 'http://127.0.0.1:4151';
FUserName := aNSQUrl;

View File

@ -2,7 +2,7 @@
//
// LoggerPro
//
// Copyright (c) 2010-2023 Daniele Teti
// Copyright (c) 2010-2024 Daniele Teti
//
// https://github.com/danieleteti/loggerpro
//
@ -39,7 +39,7 @@ type
FModuleName: string;
{$ENDIF}
public
constructor Create(ALogLayout: string = TLogLayout.LOG_LAYOUT_0); override;
constructor Create(aLogItemRenderer: ILogItemRenderer = nil); override;
procedure Setup; override;
procedure TearDown; override;
procedure WriteLog(const aLogItem: TLogItem); override;
@ -58,7 +58,7 @@ uses
{ TLoggerProOutputDebugStringAppender }
constructor TLoggerProOutputDebugStringAppender.Create(ALogLayout: string);
constructor TLoggerProOutputDebugStringAppender.Create(aLogItemRenderer: ILogItemRenderer);
begin
inherited;
end;

View File

@ -83,14 +83,13 @@ type
procedure SetRESTUrl(const Value: string);
procedure WriteLog(const aLogItem: TLogItem); override;
constructor Create(aRESTUrl: string = DEFAULT_REST_URL; aContentType: string = 'text/plain';
aLogExtendedInfo: TLoggerProExtendedInfo = DEFAULT_EXTENDED_INFO; aLogFormat: string = DEFAULT_LOG_FORMAT); reintroduce;
aLogExtendedInfo: TLoggerProExtendedInfo = DEFAULT_EXTENDED_INFO; aLogItemRenderer: ILogItemRenderer = nil); reintroduce;
property RESTUrl: string read GetRESTUrl write SetRESTUrl;
property OnCreateData: TOnCreateData read FOnCreateData write SetOnCreateData;
property OnNetSendError: TOnNetSendError read FOnNetSendError write SetOnNetSendError;
procedure TearDown; override;
procedure Setup; override;
function CreateData(const SrcLogItem: TLogItem): TStream; virtual;
function FormatLog(const aLogItem: TLogItem): string; override;
end;
implementation
@ -139,10 +138,10 @@ end;
{$ENDIF}
constructor TLoggerProRESTAppender.Create(aRESTUrl: string = DEFAULT_REST_URL; aContentType: string = 'text/plain';
aLogExtendedInfo: TLoggerProExtendedInfo = DEFAULT_EXTENDED_INFO; aLogFormat: string = DEFAULT_LOG_FORMAT);
constructor TLoggerProRESTAppender.Create(aRESTUrl: string; aContentType: string;
aLogExtendedInfo: TLoggerProExtendedInfo; aLogItemRenderer: ILogItemRenderer);
begin
inherited Create(aLogFormat);
inherited Create(aLogItemRenderer);
fRESTUrl := aRESTUrl;
fExtendedInfo := aLogExtendedInfo;
fContentType := aContentType;
@ -170,12 +169,8 @@ begin
end;
end;
function TLoggerProRESTAppender.FormatLog(const aLogItem: TLogItem): string;
begin
Result := Format(LogFormat, [datetimetostr(aLogItem.TimeStamp, FormatSettings), aLogItem.ThreadID, aLogItem.LogTypeAsString,
aLogItem.LogMessage, GetExtendedInfo, aLogItem.LogTag]);
end;
{TODO -oDanieleT -cGeneral : Currently ExtendedInfo are not logged}
function TLoggerProRESTAppender.GetExtendedInfo: string;
begin
Result := '';

View File

@ -43,7 +43,7 @@ type
FLogKeyPrefix: string;
FMaxSize: Int64;
public
constructor Create(aRedis: IRedisClient; aMaxSize: Int64 = 5000; aKeyPrefix: string = 'loggerpro'; aLogLayout: string = TLogLayout.LOG_LAYOUT_0); reintroduce;
constructor Create(aRedis: IRedisClient; aMaxSize: Int64 = 5000; aKeyPrefix: string = 'loggerpro'; aLogItemRenderer: ILogItemRenderer = nil); reintroduce;
procedure Setup; override;
procedure TearDown; override;
procedure WriteLog(const aLogItem: TLogItem); override;
@ -55,9 +55,9 @@ implementation
uses
System.SysUtils;
constructor TLoggerProRedisAppender.Create(aRedis: IRedisClient; aMaxSize: Int64; aKeyPrefix: string; aLogLayout: string);
constructor TLoggerProRedisAppender.Create(aRedis: IRedisClient; aMaxSize: Int64; aKeyPrefix: string; aLogItemRenderer: ILogItemRenderer);
begin
inherited Create(aLogLayout);
inherited Create(aLogItemRenderer);
FRedis := aRedis;
FLogKeyPrefix := aKeyPrefix;
FMaxSize := aMaxSize;

165
LoggerPro.Renderers.pas Normal file
View File

@ -0,0 +1,165 @@
// *************************************************************************** }
//
// LoggerPro
//
// Copyright (c) 2010-2024 Daniele Teti
//
// https://github.com/danieleteti/loggerpro
//
// ***************************************************************************
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ***************************************************************************
unit LoggerPro.Renderers;
interface
uses
LoggerPro, System.SysUtils;
type
TLogItemRendererDefault = class(TLogItemRenderer)
private
fInternalLogFormat: string;
fInternalFormatSettings: TFormatSettings;
fInitialized: Boolean;
protected
property InternalLogFormat: String read fInternalLogFormat;
property InternalFormatSettings: TFormatSettings read fInternalFormatSettings;
function GetLogLayoutWithPlaceHolders: String; virtual;
// ILogLayoutRenderer
procedure Setup; override;
procedure TearDown; override;
function RenderLogItem(const aLogItem: TLogItem): String; override;
end;
TLogItemRendererNoTag = class(TLogItemRendererDefault)
protected
function GetLogLayoutWithPlaceHolders: String; override;
function RenderLogItem(const aLogItem: TLogItem): String; override;
end;
TLogItemRendererNoThreadID = class(TLogItemRendererDefault)
protected
function GetLogLayoutWithPlaceHolders: String; override;
function RenderLogItem(const aLogItem: TLogItem): String; override;
end;
TLogItemRendererNoTagNoThreadID = class(TLogItemRendererDefault)
protected
function GetLogLayoutWithPlaceHolders: String; override;
function RenderLogItem(const aLogItem: TLogItem): String; override;
end;
function GetDefaultLogItemRenderer: ILogItemRenderer;
var
gDefaultLogItemRenderer: TLogItemRendererClass = TLogItemRendererDefault;
implementation
function GetDefaultLogItemRenderer: ILogItemRenderer;
begin
Result := gDefaultLogItemRenderer.Create;
end;
{ TLogItemRendererDefault }
procedure TLogItemRendererDefault.TearDown;
begin
// do nothing
end;
procedure TLogItemRendererDefault.Setup;
begin
if not fInitialized then
begin
fInternalFormatSettings := GetDefaultFormatSettings;
fInternalLogFormat := LogLayoutByPlaceHoldersToLogLayoutByIndexes(GetLogLayoutWithPlaceHolders, True);
fInitialized := True;
end;
end;
function TLogItemRendererDefault.GetLogLayoutWithPlaceHolders: String;
begin
Result := '{timestamp}[TID {threadid}][{loglevel}] {message} [{tag}]';
end;
function TLogItemRendererDefault.RenderLogItem(const aLogItem: TLogItem): String;
begin
Result := Format(InternalLogFormat, [
DateTimeToStr(ALogItem.TimeStamp, InternalFormatSettings),
ALogItem.ThreadID.ToString,
ALogItem.LogTypeAsString,
ALogItem.LogMessage,
ALogItem.LogTag
]);
end;
{ TLogItemRendererNoTag }
function TLogItemRendererNoTag.GetLogLayoutWithPlaceHolders: String;
begin
Result := '{timestamp}[TID {threadid}][{loglevel}] {message}';
end;
function TLogItemRendererNoTag.RenderLogItem(const aLogItem: TLogItem): String;
begin
Result := Format(InternalLogFormat, [
DateTimeToStr(ALogItem.TimeStamp, InternalFormatSettings),
ALogItem.ThreadID.ToString,
ALogItem.LogTypeAsString,
ALogItem.LogMessage
]);
end;
{ TLogItemRendererNoThreadID }
function TLogItemRendererNoThreadID.GetLogLayoutWithPlaceHolders: String;
begin
Result := '{timestamp}[{loglevel}] {message} [{tag}]';
end;
function TLogItemRendererNoThreadID.RenderLogItem(const aLogItem: TLogItem): String;
begin
Result := Format(InternalLogFormat, [
DateTimeToStr(ALogItem.TimeStamp, InternalFormatSettings),
ALogItem.LogTypeAsString,
ALogItem.LogMessage,
aLogItem.LogTag
]);
end;
{ TLogItemRendererNoTagNoThreadID }
function TLogItemRendererNoTagNoThreadID.GetLogLayoutWithPlaceHolders: String;
begin
Result := '{timestamp}[{loglevel}] {message}';
end;
function TLogItemRendererNoTagNoThreadID.RenderLogItem(const aLogItem: TLogItem): String;
begin
Result := Format(InternalLogFormat, [
DateTimeToStr(ALogItem.TimeStamp, InternalFormatSettings),
ALogItem.LogTypeAsString,
ALogItem.LogMessage
]);
end;
end.

View File

@ -2,7 +2,7 @@
//
// LoggerPro
//
// Copyright (c) 2010-2023 Daniele Teti
// Copyright (c) 2010-2024 Daniele Teti
//
// https://github.com/danieleteti/loggerpro
//

View File

@ -38,7 +38,7 @@ type
FLV: TListView;
FMaxLogLines: Word;
public
constructor Create(aLV: TListView; aMaxLogLines: Word = 500; aLogLayout: string = TLogLayout.LOG_LAYOUT_0); reintroduce;
constructor Create(aLV: TListView; aMaxLogLines: Word = 500; aLogItemRenderer: ILogItemRenderer = nil); reintroduce;
procedure Setup; override;
procedure TearDown; override;
procedure WriteLog(const aLogItem: TLogItem); override;
@ -53,9 +53,9 @@ uses
{ TVCLMemoLogAppender }
constructor TVCLListViewAppender.Create(aLV: TListView; aMaxLogLines: Word; aLogLayout: string);
constructor TVCLListViewAppender.Create(aLV: TListView; aMaxLogLines: Word; aLogItemRenderer: ILogItemRenderer);
begin
inherited Create(aLogLayout);
inherited Create(aLogItemRenderer);
FLV := aLV;
FMaxLogLines := aMaxLogLines;
end;

View File

@ -39,7 +39,7 @@ type
FMaxLogLines: Word;
FClearOnStartup: Boolean;
public
constructor Create(aMemo: TMemo; aMaxLogLines: Word = 100; aClearOnStartup: Boolean = False; aLogLayout: string = TLogLayout.LOG_LAYOUT_0); reintroduce;
constructor Create(aMemo: TMemo; aMaxLogLines: Word = 100; aClearOnStartup: Boolean = False; aLogItemRenderer: ILogItemRenderer = nil); reintroduce;
procedure Setup; override;
procedure TearDown; override;
procedure WriteLog(const aLogItem: TLogItem); override;
@ -54,9 +54,9 @@ uses
{ TVCLMemoLogAppender }
constructor TVCLMemoLogAppender.Create(aMemo: TMemo; aMaxLogLines: Word; aClearOnStartup: Boolean; aLogLayout: string);
constructor TVCLMemoLogAppender.Create(aMemo: TMemo; aMaxLogLines: Word; aClearOnStartup: Boolean; aLogItemRenderer: ILogItemRenderer);
begin
inherited Create(aLogLayout);
inherited Create(aLogItemRenderer);
FMemo := aMemo;
FMaxLogLines := aMaxLogLines;
FClearOnStartup := aClearOnStartup;

View File

@ -2,7 +2,7 @@
//
// LoggerPro
//
// Copyright (c) 2010-2023 Daniele Teti
// Copyright (c) 2010-2024 Daniele Teti
//
// https://github.com/danieleteti/loggerpro
//
@ -30,28 +30,8 @@ interface
uses
System.Generics.Collections,
System.SysUtils,
System.Classes,
ThreadSafeQueueU;
type
{ @abstract(Defines the default format string used by the @link(TLoggerProAppenderBase).)
The positional parameters are the followings:
@orderedList(
@itemSetNumber 0
@item TimeStamp
@item ThreadID
@item LogType
@item LogMessage
@item LogTag
)
}
TLogLayout = record
const LOG_LAYOUT_0 = '{timestamp}[TID {threadid}][{loglevel}] {message} [{tag}]';
const LOG_LAYOUT_1 = '{timestamp}[TID {threadid}][{loglevel}] {message}';
const LOG_LAYOUT_2 = '{timestamp}[{loglevel}] {message} [{tag}]';
const LOG_LAYOUT_3 = '{timestamp}[{loglevel}] {message}';
end;
ThreadSafeQueueU, System.SysUtils;
var
DefaultLoggerProMainQueueSize: Cardinal = 50000;
@ -88,7 +68,7 @@ type
@item(INFO)
@item(WARNING)
@item(ERROR)
@item(FATAL)
@item(FATAL)
) }
property LogType: TLogType read FType;
{ @abstract(The text of the log message) }
@ -103,6 +83,13 @@ type
property LogTypeAsString: string read GetLogTypeAsString;
end;
ILogItemRenderer = interface
['{CBD22D22-C387-4A97-AD5D-4945B812FDB0}']
procedure Setup;
procedure TearDown;
function RenderLogItem(const aLogItem: TLogItem): String;
end;
TLoggerProAppenderErrorEvent = reference to procedure(const AppenderClassName: string; const aFailedLogItem: TLogItem;
const Reason: TLogErrorReason; var Action: TLogErrorAction);
@ -312,17 +299,18 @@ type
FEnabled: Boolean;
FLastErrorTimeStamp: TDateTime;
FOnLogRow: TOnAppenderLogRow;
FLogFormat: string;
//FLogFormat: string;
FLogItemRenderer: ILogItemRenderer;
FFormatSettings: TFormatSettings;
protected
property LogFormat: string read FLogFormat;
// property LogFormat: string read FLogFormat;
property FormatSettings: TFormatSettings read FFormatSettings;
public
constructor Create(ALogLayout: string = TLogLayout.LOG_LAYOUT_0); virtual;
constructor Create(ALogItemRenderer: ILogItemRenderer = nil); virtual;
procedure Setup; virtual;
function FormatLog(const ALogItem: TLogItem): string; virtual;
procedure WriteLog(const aLogItem: TLogItem); virtual; abstract;
procedure TearDown; virtual; abstract;
procedure TearDown; virtual;
procedure TryToRestart(var Restarted: Boolean); virtual;
procedure SetLogLevel(const Value: TLogType);
function GetLogLevel: TLogType; inline;
@ -376,11 +364,21 @@ type
)
}
TLogItemRenderer = class abstract(TInterfacedObject, ILogItemRenderer)
protected
procedure Setup; virtual;
procedure TearDown; virtual;
function RenderLogItem(const aLogItem: TLogItem): String; virtual;abstract;
end;
TLogItemRendererClass = class of TLogItemRenderer;
function GetDefaultFormatSettings: TFormatSettings;
function StringToLogType(const aLogType: string): TLogType;
function BuildLogWriter(aAppenders: array of ILogAppender; aEventsHandlers: TLoggerProEventsHandler = nil;
aLogLevel: TLogType = TLogType.Debug): ILogWriter;
function LogLayoutByPlaceHoldersToLogLayoutByIndexes(const LogLayoutByPlaceHolders: String): String;
function LogLayoutByPlaceHoldersToLogLayoutByIndexes(const LogLayoutByPlaceHolders: String; const UseZeroBasedIncrementalIndexes: Boolean): String;
implementation
@ -389,7 +387,8 @@ uses
LoggerPro.FileAppender,
System.SyncObjs,
System.DateUtils,
System.IOUtils;
System.IOUtils,
LoggerPro.Renderers;
function GetDefaultFormatSettings: TFormatSettings;
begin
@ -400,7 +399,7 @@ begin
Result.ShortTimeFormat := 'HH:NN:SS';
end;
function LogLayoutByPlaceHoldersToLogLayoutByIndexes(const LogLayoutByPlaceHolders: String): String;
function LogLayoutByPlaceHoldersToLogLayoutByIndexes(const LogLayoutByPlaceHolders: String; const UseZeroBasedIncrementalIndexes: Boolean): String;
var
PlaceHolders, PlaceHolderWidthsAndPaddings: TArray<string>;
I: Integer;
@ -437,11 +436,30 @@ begin
PlaceHolderWidthsAndPaddings[4] := '';
Result := LogLayoutByPlaceHolders;
for I := 0 to High(PlaceHolders) do
if UseZeroBasedIncrementalIndexes then
begin
Result := Result.Replace(
'{' + PlaceHolders[I] + '}',
'%' + IntToStr(I) + ':' + PlaceHolderWidthsAndPaddings[I] + 's');
var lIdx := 0;
for I := 0 to High(PlaceHolders) do
begin
if Result.Contains('{' + PlaceHolders[I] + '}') then
begin
Result := Result.Replace(
'{' + PlaceHolders[I] + '}',
'%' + IntToStr(lIdx) + ':' + PlaceHolderWidthsAndPaddings[I] + 's');
Inc(lIdx);
end;
end;
end
else
begin
for I := 0 to High(PlaceHolders) do
begin
Result := Result.Replace(
'{' + PlaceHolders[I] + '}',
'%' + IntToStr(I) + ':' + PlaceHolderWidthsAndPaddings[I] + 's');
end;
end;
end;
@ -870,40 +888,32 @@ end;
{ TLoggerProAppenderBase }
constructor TLoggerProAppenderBase.Create(ALogLayout: string);
constructor TLoggerProAppenderBase.Create(aLogItemRenderer: ILogItemRenderer);
begin
inherited Create;
Self.FEnabled := true;
Self.FLogLevel := TLogType.Debug;
Self.FLogFormat := LogLayoutByPlaceHoldersToLogLayoutByIndexes(ALogLayout);
if Assigned(aLogItemRenderer) then
begin
Self.FLogItemRenderer := aLogItemRenderer;
end
else
begin
Self.FLogItemRenderer := GetDefaultLogItemRenderer;
end;
Self.FOnLogRow := nil;
end;
function TLoggerProAppenderBase.FormatLog(const ALogItem: TLogItem): string;
begin
if Assigned(FOnLogRow) then
FOnLogRow(ALogItem, Result)
begin
FOnLogRow(ALogItem, Result);
end
else
begin
Result := Format(FLogFormat, [
DateTimeToStr(ALogItem.TimeStamp, FFormatSettings),
ALogItem.ThreadID.ToString,
ALogItem.LogTypeAsString,
ALogItem.LogMessage,
ALogItem.LogTag
]);
// Result := Format(
// FLogFormat, [
// DateTimeToStr(ALogItem.TimeStamp, FFormatSettings),
// ALogItem.ThreadID,
// ALogItem.LogTypeAsString,
// ALogItem.LogMessage,
// ALogItem.LogTag
// ]);
Result := FLogItemRenderer.RenderLogItem(ALogItem);
end;
end;
function TLoggerProAppenderBase.GetLastErrorTimeStamp: TDateTime;
@ -929,6 +939,12 @@ end;
procedure TLoggerProAppenderBase.Setup;
begin
FFormatSettings := GetDefaultFormatSettings;
FLogItemRenderer.Setup;
end;
procedure TLoggerProAppenderBase.TearDown;
begin
FLogItemRenderer.TearDown;
end;
procedure TLoggerProAppenderBase.TryToRestart(var Restarted: Boolean);
@ -1075,5 +1091,18 @@ begin
Result := inherited;
end;
{ TLogItemRenderer }
procedure TLogItemRenderer.Setup;
begin
// do nothing
end;
procedure TLogItemRenderer.TearDown;
begin
// do nothing
end;
end.

View File

@ -20,10 +20,12 @@ LoggerPro is compatibile with
- Delphi XE3
- Delphi XE2
## What's new in 1.5.0 (repo version, beta)
## What's new in 2.0.0 (repo version, beta)
- Delphi 12 Athens Support
- FIX https://github.com/danieleteti/loggerpro/issues/72
- New LogLevel: FATAL (https://github.com/danieleteti/loggerpro/issues/80)
- New Appender: JSONL
- Added `ILogItemRenderers` (check samples)
## What's new in 1.4.0 (stable version)

View File

@ -49,6 +49,7 @@ contains
LoggerPro.UDPSyslogAppender in '..\..\LoggerPro.UDPSyslogAppender.pas',
LoggerPro.Utils in '..\..\LoggerPro.Utils.pas',
ThreadSafeQueueU in '..\..\ThreadSafeQueueU.pas',
LoggerPro.OutputDebugStringAppender in '..\..\LoggerPro.OutputDebugStringAppender.pas';
LoggerPro.OutputDebugStringAppender in '..\..\LoggerPro.OutputDebugStringAppender.pas',
LoggerPro.Renderers in '..\..\LoggerPro.Renderers.pas';
end.

View File

@ -123,6 +123,7 @@
<DCCReference Include="..\..\LoggerPro.Utils.pas"/>
<DCCReference Include="..\..\ThreadSafeQueueU.pas"/>
<DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
@ -170,6 +171,12 @@
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx64\libcgsqlite3.dylib" Class="DependencyModule"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\loggerproRT100.bpl" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl\loggerproRT100.bpl" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>loggerproRT.bpl</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>

View File

@ -49,6 +49,7 @@ contains
LoggerPro.UDPSyslogAppender in '..\..\LoggerPro.UDPSyslogAppender.pas',
LoggerPro.Utils in '..\..\LoggerPro.Utils.pas',
ThreadSafeQueueU in '..\..\ThreadSafeQueueU.pas',
LoggerPro.OutputDebugStringAppender in '..\..\LoggerPro.OutputDebugStringAppender.pas';
LoggerPro.OutputDebugStringAppender in '..\..\LoggerPro.OutputDebugStringAppender.pas',
LoggerPro.Renderers in '..\..\LoggerPro.Renderers.pas';
end.

View File

@ -123,6 +123,7 @@
<DCCReference Include="..\..\LoggerPro.Utils.pas"/>
<DCCReference Include="..\..\ThreadSafeQueueU.pas"/>
<DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
@ -171,6 +172,12 @@
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx64\libcgsqlite3.dylib" Class="DependencyModule"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\loggerproRT101.bpl" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl\loggerproRT101.bpl" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>loggerproRT.bpl</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>

View File

@ -49,6 +49,7 @@ contains
LoggerPro.UDPSyslogAppender in '..\..\LoggerPro.UDPSyslogAppender.pas',
LoggerPro.Utils in '..\..\LoggerPro.Utils.pas',
ThreadSafeQueueU in '..\..\ThreadSafeQueueU.pas',
LoggerPro.OutputDebugStringAppender in '..\..\LoggerPro.OutputDebugStringAppender.pas';
LoggerPro.OutputDebugStringAppender in '..\..\LoggerPro.OutputDebugStringAppender.pas',
LoggerPro.Renderers in '..\..\LoggerPro.Renderers.pas';
end.

View File

@ -123,6 +123,7 @@
<DCCReference Include="..\..\LoggerPro.Utils.pas"/>
<DCCReference Include="..\..\ThreadSafeQueueU.pas"/>
<DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
@ -170,6 +171,12 @@
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx64\libcgsqlite3.dylib" Class="DependencyModule"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\loggerproRT102.bpl" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl\loggerproRT102.bpl" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>loggerproRT.bpl</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>

View File

@ -49,6 +49,7 @@ contains
LoggerPro.UDPSyslogAppender in '..\..\LoggerPro.UDPSyslogAppender.pas',
LoggerPro.Utils in '..\..\LoggerPro.Utils.pas',
ThreadSafeQueueU in '..\..\ThreadSafeQueueU.pas',
LoggerPro.OutputDebugStringAppender in '..\..\LoggerPro.OutputDebugStringAppender.pas';
LoggerPro.OutputDebugStringAppender in '..\..\LoggerPro.OutputDebugStringAppender.pas',
LoggerPro.Renderers in '..\..\LoggerPro.Renderers.pas';
end.

View File

@ -120,6 +120,7 @@
<DCCReference Include="..\..\LoggerPro.Utils.pas"/>
<DCCReference Include="..\..\ThreadSafeQueueU.pas"/>
<DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
@ -167,6 +168,12 @@
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx64\libcgsqlite3.dylib" Class="DependencyModule"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\loggerproRT.bpl" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl\loggerproRT103.bpl" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>loggerproRT.bpl</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>

View File

@ -49,6 +49,8 @@ contains
LoggerPro.UDPSyslogAppender in '..\..\LoggerPro.UDPSyslogAppender.pas',
LoggerPro.Utils in '..\..\LoggerPro.Utils.pas',
ThreadSafeQueueU in '..\..\ThreadSafeQueueU.pas',
LoggerPro.OutputDebugStringAppender in '..\..\LoggerPro.OutputDebugStringAppender.pas';
LoggerPro.OutputDebugStringAppender in '..\..\LoggerPro.OutputDebugStringAppender.pas',
LoggerPro.Renderers in '..\..\LoggerPro.Renderers.pas',
LoggerPro.ConsoleAppender in '..\..\LoggerPro.ConsoleAppender.pas';
end.

View File

@ -123,6 +123,8 @@
<DCCReference Include="..\..\LoggerPro.Utils.pas"/>
<DCCReference Include="..\..\ThreadSafeQueueU.pas"/>
<DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<DCCReference Include="..\..\LoggerPro.ConsoleAppender.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
@ -167,6 +169,12 @@
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx64\libcgsqlite3.dylib" Class="DependencyModule"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\loggerproRT.bpl" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl\loggerproRT104.bpl" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>loggerproRT.bpl</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>

View File

@ -49,6 +49,7 @@ contains
LoggerPro.UDPSyslogAppender in '..\..\LoggerPro.UDPSyslogAppender.pas',
LoggerPro.Utils in '..\..\LoggerPro.Utils.pas',
ThreadSafeQueueU in '..\..\ThreadSafeQueueU.pas',
LoggerPro.OutputDebugStringAppender in '..\..\LoggerPro.OutputDebugStringAppender.pas';
LoggerPro.OutputDebugStringAppender in '..\..\LoggerPro.OutputDebugStringAppender.pas',
LoggerPro.Renderers in '..\..\LoggerPro.Renderers.pas';
end.

View File

@ -122,6 +122,7 @@
<DCCReference Include="..\..\LoggerPro.Utils.pas"/>
<DCCReference Include="..\..\ThreadSafeQueueU.pas"/>
<DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
@ -168,6 +169,12 @@
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx64\libcgsqlite3.dylib" Class="DependencyModule"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\loggerproRT.bpl" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl\loggerproRT110.bpl" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>loggerproRT.bpl</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>

View File

@ -49,6 +49,7 @@ contains
LoggerPro.UDPSyslogAppender in '..\..\LoggerPro.UDPSyslogAppender.pas',
LoggerPro.Utils in '..\..\LoggerPro.Utils.pas',
ThreadSafeQueueU in '..\..\ThreadSafeQueueU.pas',
LoggerPro.OutputDebugStringAppender in '..\..\LoggerPro.OutputDebugStringAppender.pas';
LoggerPro.OutputDebugStringAppender in '..\..\LoggerPro.OutputDebugStringAppender.pas',
LoggerPro.Renderers in '..\..\LoggerPro.Renderers.pas';
end.

View File

@ -123,6 +123,7 @@
<DCCReference Include="..\..\LoggerPro.Utils.pas"/>
<DCCReference Include="..\..\ThreadSafeQueueU.pas"/>
<DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
@ -167,6 +168,12 @@
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx64\libcgsqlite3.dylib" Class="DependencyModule"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\loggerproRT.bpl" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl\loggerproRT111.bpl" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>loggerproRT.bpl</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>
@ -558,6 +565,127 @@
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectAndroidManifest">
<Platform Name="Android">
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXDebug"/>
<DeployClass Name="ProjectOSXEntitlements"/>
<DeployClass Name="ProjectOSXInfoPList"/>
<DeployClass Name="ProjectOSXResource">
<Platform Name="OSX32">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimARM64">
<Operation>1</Operation>
</Platform>
<Platform Name="Linux64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectUWPManifest">
<Platform Name="Win32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimARM64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSEntitlements"/>
<DeployClass Name="ProjectiOSInfoPList"/>
<DeployClass Name="ProjectiOSLaunchScreen"/>
<DeployClass Name="ProjectiOSResource">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimARM64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo150">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo44">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iOS_AppStore1024">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
@ -758,127 +886,6 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectAndroidManifest">
<Platform Name="Android">
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimARM64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSEntitlements"/>
<DeployClass Name="ProjectiOSInfoPList"/>
<DeployClass Name="ProjectiOSLaunchScreen"/>
<DeployClass Name="ProjectiOSResource">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimARM64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXDebug"/>
<DeployClass Name="ProjectOSXEntitlements"/>
<DeployClass Name="ProjectOSXInfoPList"/>
<DeployClass Name="ProjectOSXResource">
<Platform Name="OSX32">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimARM64">
<Operation>1</Operation>
</Platform>
<Platform Name="Linux64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectUWPManifest">
<Platform Name="Win32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo150">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo44">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>

View File

@ -49,6 +49,8 @@ contains
LoggerPro.UDPSyslogAppender in '..\..\LoggerPro.UDPSyslogAppender.pas',
LoggerPro.Utils in '..\..\LoggerPro.Utils.pas',
ThreadSafeQueueU in '..\..\ThreadSafeQueueU.pas',
LoggerPro.OutputDebugStringAppender in '..\..\LoggerPro.OutputDebugStringAppender.pas';
LoggerPro.OutputDebugStringAppender in '..\..\LoggerPro.OutputDebugStringAppender.pas',
LoggerPro.Renderers in '..\..\LoggerPro.Renderers.pas',
LoggerPro.ConsoleAppender in '..\..\LoggerPro.ConsoleAppender.pas';
end.

View File

@ -13,6 +13,16 @@
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Android' and '$(Base)'=='true') or '$(Base_Android)'!=''">
<Base_Android>true</Base_Android>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Android64' and '$(Base)'=='true') or '$(Base_Android64)'!=''">
<Base_Android64>true</Base_Android64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
@ -49,6 +59,16 @@
<SanitizedProjectName>loggerproRT</SanitizedProjectName>
<RuntimeOnlyPackage>true</RuntimeOnlyPackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Android)'!=''">
<VerInfo_Keys>package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey=</VerInfo_Keys>
<BT_BuildType>Debug</BT_BuildType>
<EnabledSysJars>activity-1.7.2.dex.jar;annotation-experimental-1.3.0.dex.jar;annotation-jvm-1.6.0.dex.jar;annotations-13.0.dex.jar;appcompat-1.2.0.dex.jar;appcompat-resources-1.2.0.dex.jar;billing-6.0.1.dex.jar;biometric-1.1.0.dex.jar;browser-1.4.0.dex.jar;cloud-messaging.dex.jar;collection-1.1.0.dex.jar;concurrent-futures-1.1.0.dex.jar;core-1.10.1.dex.jar;core-common-2.2.0.dex.jar;core-ktx-1.10.1.dex.jar;core-runtime-2.2.0.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;error_prone_annotations-2.9.0.dex.jar;exifinterface-1.3.6.dex.jar;firebase-annotations-16.2.0.dex.jar;firebase-common-20.3.1.dex.jar;firebase-components-17.1.0.dex.jar;firebase-datatransport-18.1.7.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-encoders-proto-16.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.1.3.dex.jar;firebase-installations-interop-17.1.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-23.1.2.dex.jar;fmx.dex.jar;fragment-1.2.5.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;kotlin-stdlib-1.8.22.dex.jar;kotlin-stdlib-common-1.8.22.dex.jar;kotlin-stdlib-jdk7-1.8.22.dex.jar;kotlin-stdlib-jdk8-1.8.22.dex.jar;kotlinx-coroutines-android-1.6.4.dex.jar;kotlinx-coroutines-core-jvm-1.6.4.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.6.1.dex.jar;lifecycle-livedata-2.6.1.dex.jar;lifecycle-livedata-core-2.6.1.dex.jar;lifecycle-runtime-2.6.1.dex.jar;lifecycle-service-2.6.1.dex.jar;lifecycle-viewmodel-2.6.1.dex.jar;lifecycle-viewmodel-savedstate-2.6.1.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;okio-jvm-3.4.0.dex.jar;play-services-ads-22.2.0.dex.jar;play-services-ads-base-22.2.0.dex.jar;play-services-ads-identifier-18.0.0.dex.jar;play-services-ads-lite-22.2.0.dex.jar;play-services-appset-16.0.1.dex.jar;play-services-base-18.1.0.dex.jar;play-services-basement-18.1.0.dex.jar;play-services-cloud-messaging-17.0.1.dex.jar;play-services-location-21.0.1.dex.jar;play-services-maps-18.1.0.dex.jar;play-services-measurement-base-20.1.2.dex.jar;play-services-measurement-sdk-api-20.1.2.dex.jar;play-services-stats-17.0.2.dex.jar;play-services-tasks-18.0.2.dex.jar;print-1.0.0.dex.jar;profileinstaller-1.3.0.dex.jar;room-common-2.2.5.dex.jar;room-runtime-2.2.5.dex.jar;savedstate-1.2.1.dex.jar;sqlite-2.1.0.dex.jar;sqlite-framework-2.1.0.dex.jar;startup-runtime-1.1.1.dex.jar;tracing-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.1.8.dex.jar;transport-runtime-3.1.8.dex.jar;user-messaging-platform-2.0.0.dex.jar;vectordrawable-1.1.0.dex.jar;vectordrawable-animated-1.1.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.7.0.dex.jar</EnabledSysJars>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Android64)'!=''">
<VerInfo_Keys>package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey=</VerInfo_Keys>
<BT_BuildType>Debug</BT_BuildType>
<EnabledSysJars>activity-1.7.2.dex.jar;annotation-experimental-1.3.0.dex.jar;annotation-jvm-1.6.0.dex.jar;annotations-13.0.dex.jar;appcompat-1.2.0.dex.jar;appcompat-resources-1.2.0.dex.jar;billing-6.0.1.dex.jar;biometric-1.1.0.dex.jar;browser-1.4.0.dex.jar;cloud-messaging.dex.jar;collection-1.1.0.dex.jar;concurrent-futures-1.1.0.dex.jar;core-1.10.1.dex.jar;core-common-2.2.0.dex.jar;core-ktx-1.10.1.dex.jar;core-runtime-2.2.0.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;error_prone_annotations-2.9.0.dex.jar;exifinterface-1.3.6.dex.jar;firebase-annotations-16.2.0.dex.jar;firebase-common-20.3.1.dex.jar;firebase-components-17.1.0.dex.jar;firebase-datatransport-18.1.7.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-encoders-proto-16.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.1.3.dex.jar;firebase-installations-interop-17.1.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-23.1.2.dex.jar;fmx.dex.jar;fragment-1.2.5.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;kotlin-stdlib-1.8.22.dex.jar;kotlin-stdlib-common-1.8.22.dex.jar;kotlin-stdlib-jdk7-1.8.22.dex.jar;kotlin-stdlib-jdk8-1.8.22.dex.jar;kotlinx-coroutines-android-1.6.4.dex.jar;kotlinx-coroutines-core-jvm-1.6.4.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.6.1.dex.jar;lifecycle-livedata-2.6.1.dex.jar;lifecycle-livedata-core-2.6.1.dex.jar;lifecycle-runtime-2.6.1.dex.jar;lifecycle-service-2.6.1.dex.jar;lifecycle-viewmodel-2.6.1.dex.jar;lifecycle-viewmodel-savedstate-2.6.1.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;okio-jvm-3.4.0.dex.jar;play-services-ads-22.2.0.dex.jar;play-services-ads-base-22.2.0.dex.jar;play-services-ads-identifier-18.0.0.dex.jar;play-services-ads-lite-22.2.0.dex.jar;play-services-appset-16.0.1.dex.jar;play-services-base-18.1.0.dex.jar;play-services-basement-18.1.0.dex.jar;play-services-cloud-messaging-17.0.1.dex.jar;play-services-location-21.0.1.dex.jar;play-services-maps-18.1.0.dex.jar;play-services-measurement-base-20.1.2.dex.jar;play-services-measurement-sdk-api-20.1.2.dex.jar;play-services-stats-17.0.2.dex.jar;play-services-tasks-18.0.2.dex.jar;print-1.0.0.dex.jar;profileinstaller-1.3.0.dex.jar;room-common-2.2.5.dex.jar;room-runtime-2.2.5.dex.jar;savedstate-1.2.1.dex.jar;sqlite-2.1.0.dex.jar;sqlite-framework-2.1.0.dex.jar;startup-runtime-1.1.1.dex.jar;tracing-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.1.8.dex.jar;transport-runtime-3.1.8.dex.jar;user-messaging-platform-2.0.0.dex.jar;vectordrawable-1.1.0.dex.jar;vectordrawable-animated-1.1.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.7.0.dex.jar</EnabledSysJars>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<BT_BuildType>Debug</BT_BuildType>
@ -103,6 +123,8 @@
<DCCReference Include="..\..\LoggerPro.Utils.pas"/>
<DCCReference Include="..\..\ThreadSafeQueueU.pas"/>
<DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<DCCReference Include="..\..\LoggerPro.ConsoleAppender.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
@ -149,6 +171,12 @@
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx64\libcgsqlite3.dylib" Class="DependencyModule"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\loggerproRT.bpl" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\23.0\Bpl\loggerproRT113.bpl" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>loggerproRT.bpl</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>
@ -1005,6 +1033,9 @@
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
</Deployment>
<Platforms>
<Platform value="Android">False</Platform>
<Platform value="Android64">False</Platform>
<Platform value="Linux64">False</Platform>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>

View File

@ -49,6 +49,7 @@ contains
LoggerPro.UDPSyslogAppender in '..\..\LoggerPro.UDPSyslogAppender.pas',
LoggerPro.Utils in '..\..\LoggerPro.Utils.pas',
ThreadSafeQueueU in '..\..\ThreadSafeQueueU.pas',
LoggerPro.OutputDebugStringAppender in '..\..\LoggerPro.OutputDebugStringAppender.pas';
LoggerPro.OutputDebugStringAppender in '..\..\LoggerPro.OutputDebugStringAppender.pas',
LoggerPro.Renderers in '..\..\LoggerPro.Renderers.pas';
end.

View File

@ -126,6 +126,7 @@
<DCCReference Include="..\..\LoggerPro.Utils.pas"/>
<DCCReference Include="..\..\ThreadSafeQueueU.pas"/>
<DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
@ -170,6 +171,12 @@
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx64\libcgsqlite3.dylib" Class="DependencyModule"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\loggerproRT.bpl" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\23.0\Bpl\loggerproRT120.bpl" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>loggerproRT.bpl</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>

View File

@ -11,7 +11,7 @@ function Log: ILogWriter;
implementation
uses
LoggerPro.FileAppender, System.IOUtils {TPath};
LoggerPro.FileAppender, System.IOUtils {TPath}, LoggerPro.Renderers;
var
_Log: ILogWriter;
@ -24,13 +24,6 @@ end;
initialization
// The TLoggerProFileAppender has its defaults defined as follows:
// TLogLayout = record
// const LOG_LAYOUT_0 = '{timestamp} [TID {threadid}][{loglevel}] {message} [{tag}]'; // << Default
// const LOG_LAYOUT_1 = '{timestamp} [TID {threadid}][{loglevel}] {message}';
// const LOG_LAYOUT_2 = '{timestamp} [{loglevel}] {message} [{tag}]';
// const LOG_LAYOUT_3 = '{timestamp} [{loglevel}] {message}';
// end;
//
// DEFAULT_MAX_BACKUP_FILE_COUNT = 5;
// DEFAULT_MAX_FILE_SIZE_KB = 1000;
//
@ -50,21 +43,26 @@ initialization
// )]);
//
// Creates log in the same folder with PID in the filename
// _Log := BuildLogWriter([TLoggerProFileAppender.Create(10, 5, '',
// TLoggerProFileAppender.DEFAULT_FILENAME_FORMAT_WITH_PID)]);
// _Log := BuildLogWriter([TLoggerProFileAppender.Create(
// 10,
// 5,
// '',
// TLoggerProFileAppender.DEFAULT_FILENAME_FORMAT_WITH_PID,
// GetDefaultLogRenderer
// )]);
//
// Creates logs in the ..\..\ folder using the default filename
// The FilteringFileAppender selects the 'TAG1' and 'TAG2' log messages into a separate file
// _Log := BuildLogWriter([
// TLoggerProFileAppender.Create(10, 5, '..\..',
// TLoggerProFileAppender.DEFAULT_FILENAME_FORMAT,
// TLogLayout.LOG_LAYOUT_0),
// TLoggerProFilter.Build(
// TLoggerProSimpleFileAppender.Create(10, 5, '..\..'),
// function(ALogItem: TLogItem): boolean
// begin
// Result := (ALogItem.LogTag = 'TAG1') or (ALogItem.LogTag = 'TAG2');
// end)
// ]);
//
_Log := BuildLogWriter([
TLoggerProFileAppender.Create(10, 5, '..\..',
TLoggerProFileAppender.DEFAULT_FILENAME_FORMAT,
TLogItemRendererNoTag.Create),
TLoggerProFilter.Build(
TLoggerProSimpleFileAppender.Create(10, 5, '..\..'),
function(ALogItem: TLogItem): boolean
begin
Result := (ALogItem.LogTag = 'TAG1') or (ALogItem.LogTag = 'TAG2');
end)
]);
end.

View File

@ -3,7 +3,8 @@ program file_appender;
uses
Vcl.Forms,
LoggerProConfig in 'LoggerProConfig.pas',
MainFormU in '..\common\MainFormU.pas' {MainForm};
MainFormU in '..\common\MainFormU.pas' {MainForm},
LoggerPro.Renderers in '..\..\LoggerPro.Renderers.pas';
{$R *.res}

View File

@ -135,6 +135,7 @@
<Form>MainForm</Form>
<FormType>dfm</FormType>
</DCCReference>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
@ -162,6 +163,18 @@
</Delphi.Personality>
<Deployment Version="4">
<DeployFile LocalName="Win32\Debug\file_appender.exe" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="bin\file_appender.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win64">
<RemoteName>file_appender.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="bin\file_appender.rsm" Configuration="Debug" Class="DebugSymbols">
<Platform Name="Win64">
<RemoteName>file_appender.rsm</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>

View File

@ -26,10 +26,7 @@ initialization
// Create up to 10 logs in the exe\logs folder, max 2MiB each, using DEFAULT_FILENAME_FORMAT = '{module}.{number}.log';
_Log := BuildLogWriter([
TLoggerProSimpleFileAppender.Create(10, 2048, 'logs',
'{module}.{pid}.{number}.log',
TLogLayout.LOG_LAYOUT_0)
TLoggerProSimpleFileAppender.Create(10, 2048, 'logs')
]);
end.

View File

@ -3,7 +3,7 @@ unit LoggerProConfig;
interface
uses
LoggerPro;
LoggerPro, LoggerPro.Renderers;
function Log: ILogWriter;
@ -22,6 +22,10 @@ end;
initialization
LoggerPro.Renderers.gDefaultLogItemRenderer := TLogItemRendererNoTag; //optional
_Log := BuildLogWriter([TLoggerProConsoleAppender.Create]);
if not IsConsole then
AllocConsole;

View File

@ -6,7 +6,8 @@ uses
MainFormU in '..\common\MainFormU.pas' {MainForm},
LoggerPro.JSONLFileAppender in '..\..\LoggerPro.JSONLFileAppender.pas',
LoggerPro.FileAppender in '..\..\LoggerPro.FileAppender.pas',
LoggerPro in '..\..\LoggerPro.pas';
LoggerPro in '..\..\LoggerPro.pas',
LoggerPro.Renderers in '..\..\LoggerPro.Renderers.pas';
{$R *.res}

View File

@ -127,6 +127,7 @@
<DCCReference Include="..\..\LoggerPro.JSONLFileAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.FileAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
@ -159,7 +160,7 @@
<Platform value="Win64">False</Platform>
</Platforms>
<Deployment Version="4">
<DeployFile LocalName="jsonl_appender.exe" Configuration="Debug" Class="ProjectOutput">
<DeployFile LocalName="bin\jsonl_appender.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>jsonl_appender.exe</RemoteName>
<Overwrite>true</Overwrite>

View File

@ -1244,6 +1244,7 @@
<Platforms>
<Platform value="Android">True</Platform>
<Platform value="Android64">True</Platform>
<Platform value="Linux64">False</Platform>
<Platform value="Win32">True</Platform>
<Platform value="Win64">True</Platform>
</Platforms>

View File

@ -36,22 +36,22 @@
<Projects Include="100_udp_syslog\udp_syslog.dproj">
<Dependencies/>
</Projects>
<Projects Include="110_rest_appender\RESTAppenderSample.dproj">
<Dependencies/>
</Projects>
<Projects Include="110_rest_appender_mobile\RESTAppenderMobileSample.dproj">
<Dependencies/>
</Projects>
<Projects Include="rest_logs_collector\RESTLogsCollector.dproj">
<Projects Include="08_email_appender\email_appender.dproj">
<Dependencies/>
</Projects>
<Projects Include="90_remote_logging_with_redis\REDISAppenderSample.dproj">
<Dependencies/>
</Projects>
<Projects Include="rest_logs_collector\RESTLogsCollector.dproj">
<Dependencies/>
</Projects>
<Projects Include="110_rest_appender\RESTAppenderSample.dproj">
<Dependencies/>
</Projects>
<Projects Include="90_remote_logging_with_redis\redis_logs_viewer\RedisLogsViewer.dproj">
<Dependencies/>
</Projects>
<Projects Include="08_email_appender\email_appender.dproj">
<Projects Include="110_rest_appender_mobile\RESTAppenderMobileSample.dproj">
<Dependencies/>
</Projects>
</ItemGroup>
@ -161,32 +161,14 @@
<Target Name="udp_syslog:Make">
<MSBuild Projects="100_udp_syslog\udp_syslog.dproj" Targets="Make"/>
</Target>
<Target Name="RESTAppenderSample">
<MSBuild Projects="110_rest_appender\RESTAppenderSample.dproj"/>
<Target Name="email_appender">
<MSBuild Projects="08_email_appender\email_appender.dproj"/>
</Target>
<Target Name="RESTAppenderSample:Clean">
<MSBuild Projects="110_rest_appender\RESTAppenderSample.dproj" Targets="Clean"/>
<Target Name="email_appender:Clean">
<MSBuild Projects="08_email_appender\email_appender.dproj" Targets="Clean"/>
</Target>
<Target Name="RESTAppenderSample:Make">
<MSBuild Projects="110_rest_appender\RESTAppenderSample.dproj" Targets="Make"/>
</Target>
<Target Name="RESTAppenderMobileSample">
<MSBuild Projects="110_rest_appender_mobile\RESTAppenderMobileSample.dproj"/>
</Target>
<Target Name="RESTAppenderMobileSample:Clean">
<MSBuild Projects="110_rest_appender_mobile\RESTAppenderMobileSample.dproj" Targets="Clean"/>
</Target>
<Target Name="RESTAppenderMobileSample:Make">
<MSBuild Projects="110_rest_appender_mobile\RESTAppenderMobileSample.dproj" Targets="Make"/>
</Target>
<Target Name="RESTLogsCollector">
<MSBuild Projects="rest_logs_collector\RESTLogsCollector.dproj"/>
</Target>
<Target Name="RESTLogsCollector:Clean">
<MSBuild Projects="rest_logs_collector\RESTLogsCollector.dproj" Targets="Clean"/>
</Target>
<Target Name="RESTLogsCollector:Make">
<MSBuild Projects="rest_logs_collector\RESTLogsCollector.dproj" Targets="Make"/>
<Target Name="email_appender:Make">
<MSBuild Projects="08_email_appender\email_appender.dproj" Targets="Make"/>
</Target>
<Target Name="REDISAppenderSample">
<MSBuild Projects="90_remote_logging_with_redis\REDISAppenderSample.dproj"/>
@ -197,6 +179,24 @@
<Target Name="REDISAppenderSample:Make">
<MSBuild Projects="90_remote_logging_with_redis\REDISAppenderSample.dproj" Targets="Make"/>
</Target>
<Target Name="RESTLogsCollector">
<MSBuild Projects="rest_logs_collector\RESTLogsCollector.dproj"/>
</Target>
<Target Name="RESTLogsCollector:Clean">
<MSBuild Projects="rest_logs_collector\RESTLogsCollector.dproj" Targets="Clean"/>
</Target>
<Target Name="RESTLogsCollector:Make">
<MSBuild Projects="rest_logs_collector\RESTLogsCollector.dproj" Targets="Make"/>
</Target>
<Target Name="RESTAppenderSample">
<MSBuild Projects="110_rest_appender\RESTAppenderSample.dproj"/>
</Target>
<Target Name="RESTAppenderSample:Clean">
<MSBuild Projects="110_rest_appender\RESTAppenderSample.dproj" Targets="Clean"/>
</Target>
<Target Name="RESTAppenderSample:Make">
<MSBuild Projects="110_rest_appender\RESTAppenderSample.dproj" Targets="Make"/>
</Target>
<Target Name="RedisLogsViewer">
<MSBuild Projects="90_remote_logging_with_redis\redis_logs_viewer\RedisLogsViewer.dproj"/>
</Target>
@ -206,23 +206,23 @@
<Target Name="RedisLogsViewer:Make">
<MSBuild Projects="90_remote_logging_with_redis\redis_logs_viewer\RedisLogsViewer.dproj" Targets="Make"/>
</Target>
<Target Name="email_appender">
<MSBuild Projects="08_email_appender\email_appender.dproj"/>
<Target Name="RESTAppenderMobileSample">
<MSBuild Projects="110_rest_appender_mobile\RESTAppenderMobileSample.dproj"/>
</Target>
<Target Name="email_appender:Clean">
<MSBuild Projects="08_email_appender\email_appender.dproj" Targets="Clean"/>
<Target Name="RESTAppenderMobileSample:Clean">
<MSBuild Projects="110_rest_appender_mobile\RESTAppenderMobileSample.dproj" Targets="Clean"/>
</Target>
<Target Name="email_appender:Make">
<MSBuild Projects="08_email_appender\email_appender.dproj" Targets="Make"/>
<Target Name="RESTAppenderMobileSample:Make">
<MSBuild Projects="110_rest_appender_mobile\RESTAppenderMobileSample.dproj" Targets="Make"/>
</Target>
<Target Name="Build">
<CallTarget Targets="global_logger;file_appender;simple_file_appender;console_appender;outputdebugstring_appender;multiple_appenders;multiple_loggers;jsonl_appender;custom_appender;vcl_appenders;udp_syslog;RESTAppenderSample;RESTAppenderMobileSample;RESTLogsCollector;REDISAppenderSample;RedisLogsViewer;email_appender"/>
<CallTarget Targets="global_logger;file_appender;simple_file_appender;console_appender;outputdebugstring_appender;multiple_appenders;multiple_loggers;jsonl_appender;custom_appender;vcl_appenders;udp_syslog;email_appender;REDISAppenderSample;RESTLogsCollector;RESTAppenderSample;RedisLogsViewer;RESTAppenderMobileSample"/>
</Target>
<Target Name="Clean">
<CallTarget Targets="global_logger:Clean;file_appender:Clean;simple_file_appender:Clean;console_appender:Clean;outputdebugstring_appender:Clean;multiple_appenders:Clean;multiple_loggers:Clean;jsonl_appender:Clean;custom_appender:Clean;vcl_appenders:Clean;udp_syslog:Clean;RESTAppenderSample:Clean;RESTAppenderMobileSample:Clean;RESTLogsCollector:Clean;REDISAppenderSample:Clean;RedisLogsViewer:Clean;email_appender:Clean"/>
<CallTarget Targets="global_logger:Clean;file_appender:Clean;simple_file_appender:Clean;console_appender:Clean;outputdebugstring_appender:Clean;multiple_appenders:Clean;multiple_loggers:Clean;jsonl_appender:Clean;custom_appender:Clean;vcl_appenders:Clean;udp_syslog:Clean;email_appender:Clean;REDISAppenderSample:Clean;RESTLogsCollector:Clean;RESTAppenderSample:Clean;RedisLogsViewer:Clean;RESTAppenderMobileSample:Clean"/>
</Target>
<Target Name="Make">
<CallTarget Targets="global_logger:Make;file_appender:Make;simple_file_appender:Make;console_appender:Make;outputdebugstring_appender:Make;multiple_appenders:Make;multiple_loggers:Make;jsonl_appender:Make;custom_appender:Make;vcl_appenders:Make;udp_syslog:Make;RESTAppenderSample:Make;RESTAppenderMobileSample:Make;RESTLogsCollector:Make;REDISAppenderSample:Make;RedisLogsViewer:Make;email_appender:Make"/>
<CallTarget Targets="global_logger:Make;file_appender:Make;simple_file_appender:Make;console_appender:Make;outputdebugstring_appender:Make;multiple_appenders:Make;multiple_loggers:Make;jsonl_appender:Make;custom_appender:Make;vcl_appenders:Make;udp_syslog:Make;email_appender:Make;REDISAppenderSample:Make;RESTLogsCollector:Make;RESTAppenderSample:Make;RedisLogsViewer:Make;RESTAppenderMobileSample:Make"/>
</Target>
<Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/>
</Project>

View File

@ -14,9 +14,7 @@ uses
IdHTTPWebBrokerBridge,
LogsCollectorControllerU in 'LogsCollectorControllerU.pas',
MainWMU in 'MainWMU.pas' {MyWebModule: TWebModule},
LoggerProConfig in 'LoggerProConfig.pas',
LoggerPro.FileAppender in '..\..\LoggerPro.FileAppender.pas',
LoggerPro in '..\..\LoggerPro.pas';
LoggerProConfig in 'LoggerProConfig.pas';
{$R *.res}

View File

@ -132,8 +132,6 @@
<DesignClass>TWebModule</DesignClass>
</DCCReference>
<DCCReference Include="LoggerProConfig.pas"/>
<DCCReference Include="..\..\LoggerPro.FileAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>