Updated LoggerPro to v2.0

This commit is contained in:
Daniele Teti 2024-01-23 17:25:13 +01:00
commit 7ec97f4aea
43 changed files with 633 additions and 332 deletions

View File

@ -48,7 +48,7 @@ type
/// </summary> /// </summary>
procedure PrepareMessage(const aLogItem: TLogItem; out aSubject, aBody: String); virtual; procedure PrepareMessage(const aLogItem: TLogItem; out aSubject, aBody: String); virtual;
public 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 Setup; override;
procedure TearDown; override; procedure TearDown; override;
procedure WriteLog(const aLogItem: TLogItem); override; procedure WriteLog(const aLogItem: TLogItem); override;
@ -60,9 +60,9 @@ implementation
uses uses
System.SysUtils, IdMessage; 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 begin
inherited Create(aLogLayout); inherited Create(aLogItemRenderer);
FSMTP := aSMTP; FSMTP := aSMTP;
FFromAddresses := aFromAddresses; FFromAddresses := aFromAddresses;
FToAddresses := aToAddresses; FToAddresses := aToAddresses;

View File

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

View File

@ -2,7 +2,7 @@
// //
// LoggerPro // LoggerPro
// //
// Copyright (c) 2010-2023 Daniele Teti // Copyright (c) 2010-2024 Daniele Teti
// //
// https://github.com/danieleteti/loggerpro // https://github.com/danieleteti/loggerpro
// //
@ -32,8 +32,7 @@ interface
uses uses
LoggerPro.FileAppender, LoggerPro.FileAppender,
System.Classes, System.Classes,
LoggerPro, LoggerPro, System.SysUtils;
System.SysUtils;
type type
{ @abstract(JSONL file appender with multiple tags) { @abstract(JSONL file appender with multiple tags)
@ -45,7 +44,6 @@ type
procedure EmitStartRotateLogItem(aWriter: TStreamWriter); override; procedure EmitStartRotateLogItem(aWriter: TStreamWriter); override;
procedure EmitEndRotateLogItem(aWriter: TStreamWriter); override; procedure EmitEndRotateLogItem(aWriter: TStreamWriter); override;
public public
function FormatLog(const ALogItem: TLogItem): string; override;
constructor Create(aMaxBackupFileCount: Integer = TLoggerProFileAppender.DEFAULT_MAX_BACKUP_FILE_COUNT; constructor Create(aMaxBackupFileCount: Integer = TLoggerProFileAppender.DEFAULT_MAX_BACKUP_FILE_COUNT;
aMaxFileSizeInKiloByte: Integer = TLoggerProFileAppender.DEFAULT_MAX_FILE_SIZE_KB; aLogsFolder: string = ''; aMaxFileSizeInKiloByte: Integer = TLoggerProFileAppender.DEFAULT_MAX_FILE_SIZE_KB; aLogsFolder: string = '';
aLogFileNameFormat: string = TLoggerProSimpleFileAppender.DEFAULT_FILENAME_FORMAT; aEncoding: TEncoding = nil); 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 } { TLoggerProJSONLFileAppender }
constructor TLoggerProJSONLFileAppender.Create( constructor TLoggerProJSONLFileAppender.Create(
@ -78,7 +88,7 @@ begin
aMaxFileSizeInKiloByte, aMaxFileSizeInKiloByte,
aLogsFolder, aLogsFolder,
aLogFileNameFormat, aLogFileNameFormat,
TLogLayout.LOG_LAYOUT_0, TLogItemRendererJSONL.Create,
aEncoding); aEncoding);
end; end;
@ -92,33 +102,6 @@ begin
// do nothing // do nothing
end; 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; function TLoggerProJSONLFileAppender.GetLogFileName(const aTag: string; const aFileNumber: Integer): string;
var var
lOrigFName, lOrigExt: string; lOrigFName, lOrigExt: string;
@ -133,5 +116,43 @@ begin
end; 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. end.

View File

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

View File

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

View File

@ -83,14 +83,13 @@ type
procedure SetRESTUrl(const Value: string); procedure SetRESTUrl(const Value: string);
procedure WriteLog(const aLogItem: TLogItem); override; procedure WriteLog(const aLogItem: TLogItem); override;
constructor Create(aRESTUrl: string = DEFAULT_REST_URL; aContentType: string = 'text/plain'; 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 RESTUrl: string read GetRESTUrl write SetRESTUrl;
property OnCreateData: TOnCreateData read FOnCreateData write SetOnCreateData; property OnCreateData: TOnCreateData read FOnCreateData write SetOnCreateData;
property OnNetSendError: TOnNetSendError read FOnNetSendError write SetOnNetSendError; property OnNetSendError: TOnNetSendError read FOnNetSendError write SetOnNetSendError;
procedure TearDown; override; procedure TearDown; override;
procedure Setup; override; procedure Setup; override;
function CreateData(const SrcLogItem: TLogItem): TStream; virtual; function CreateData(const SrcLogItem: TLogItem): TStream; virtual;
function FormatLog(const aLogItem: TLogItem): string; override;
end; end;
implementation implementation
@ -139,10 +138,10 @@ end;
{$ENDIF} {$ENDIF}
constructor TLoggerProRESTAppender.Create(aRESTUrl: string = DEFAULT_REST_URL; aContentType: string = 'text/plain'; constructor TLoggerProRESTAppender.Create(aRESTUrl: string; aContentType: string;
aLogExtendedInfo: TLoggerProExtendedInfo = DEFAULT_EXTENDED_INFO; aLogFormat: string = DEFAULT_LOG_FORMAT); aLogExtendedInfo: TLoggerProExtendedInfo; aLogItemRenderer: ILogItemRenderer);
begin begin
inherited Create(aLogFormat); inherited Create(aLogItemRenderer);
fRESTUrl := aRESTUrl; fRESTUrl := aRESTUrl;
fExtendedInfo := aLogExtendedInfo; fExtendedInfo := aLogExtendedInfo;
fContentType := aContentType; fContentType := aContentType;
@ -170,12 +169,8 @@ begin
end; end;
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; function TLoggerProRESTAppender.GetExtendedInfo: string;
begin begin
Result := ''; Result := '';

View File

@ -43,7 +43,7 @@ type
FLogKeyPrefix: string; FLogKeyPrefix: string;
FMaxSize: Int64; FMaxSize: Int64;
public 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 Setup; override;
procedure TearDown; override; procedure TearDown; override;
procedure WriteLog(const aLogItem: TLogItem); override; procedure WriteLog(const aLogItem: TLogItem); override;
@ -55,9 +55,9 @@ implementation
uses uses
System.SysUtils; 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 begin
inherited Create(aLogLayout); inherited Create(aLogItemRenderer);
FRedis := aRedis; FRedis := aRedis;
FLogKeyPrefix := aKeyPrefix; FLogKeyPrefix := aKeyPrefix;
FMaxSize := aMaxSize; FMaxSize := aMaxSize;

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 // LoggerPro
// //
// Copyright (c) 2010-2023 Daniele Teti // Copyright (c) 2010-2024 Daniele Teti
// //
// https://github.com/danieleteti/loggerpro // https://github.com/danieleteti/loggerpro
// //

View File

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

View File

@ -39,7 +39,7 @@ type
FMaxLogLines: Word; FMaxLogLines: Word;
FClearOnStartup: Boolean; FClearOnStartup: Boolean;
public 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 Setup; override;
procedure TearDown; override; procedure TearDown; override;
procedure WriteLog(const aLogItem: TLogItem); override; procedure WriteLog(const aLogItem: TLogItem); override;
@ -54,9 +54,9 @@ uses
{ TVCLMemoLogAppender } { TVCLMemoLogAppender }
constructor TVCLMemoLogAppender.Create(aMemo: TMemo; aMaxLogLines: Word; aClearOnStartup: Boolean; aLogLayout: string); constructor TVCLMemoLogAppender.Create(aMemo: TMemo; aMaxLogLines: Word; aClearOnStartup: Boolean; aLogItemRenderer: ILogItemRenderer);
begin begin
inherited Create(aLogLayout); inherited Create(aLogItemRenderer);
FMemo := aMemo; FMemo := aMemo;
FMaxLogLines := aMaxLogLines; FMaxLogLines := aMaxLogLines;
FClearOnStartup := aClearOnStartup; FClearOnStartup := aClearOnStartup;

View File

@ -2,7 +2,7 @@
// //
// LoggerPro // LoggerPro
// //
// Copyright (c) 2010-2023 Daniele Teti // Copyright (c) 2010-2024 Daniele Teti
// //
// https://github.com/danieleteti/loggerpro // https://github.com/danieleteti/loggerpro
// //
@ -30,28 +30,8 @@ interface
uses uses
System.Generics.Collections, System.Generics.Collections,
System.SysUtils,
System.Classes, System.Classes,
ThreadSafeQueueU; ThreadSafeQueueU, System.SysUtils;
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;
var var
DefaultLoggerProMainQueueSize: Cardinal = 50000; DefaultLoggerProMainQueueSize: Cardinal = 50000;
@ -103,6 +83,13 @@ type
property LogTypeAsString: string read GetLogTypeAsString; property LogTypeAsString: string read GetLogTypeAsString;
end; 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; TLoggerProAppenderErrorEvent = reference to procedure(const AppenderClassName: string; const aFailedLogItem: TLogItem;
const Reason: TLogErrorReason; var Action: TLogErrorAction); const Reason: TLogErrorReason; var Action: TLogErrorAction);
@ -312,17 +299,18 @@ type
FEnabled: Boolean; FEnabled: Boolean;
FLastErrorTimeStamp: TDateTime; FLastErrorTimeStamp: TDateTime;
FOnLogRow: TOnAppenderLogRow; FOnLogRow: TOnAppenderLogRow;
FLogFormat: string; //FLogFormat: string;
FLogItemRenderer: ILogItemRenderer;
FFormatSettings: TFormatSettings; FFormatSettings: TFormatSettings;
protected protected
property LogFormat: string read FLogFormat; // property LogFormat: string read FLogFormat;
property FormatSettings: TFormatSettings read FFormatSettings; property FormatSettings: TFormatSettings read FFormatSettings;
public public
constructor Create(ALogLayout: string = TLogLayout.LOG_LAYOUT_0); virtual; constructor Create(ALogItemRenderer: ILogItemRenderer = nil); virtual;
procedure Setup; virtual; procedure Setup; virtual;
function FormatLog(const ALogItem: TLogItem): string; virtual; function FormatLog(const ALogItem: TLogItem): string; virtual;
procedure WriteLog(const aLogItem: TLogItem); virtual; abstract; procedure WriteLog(const aLogItem: TLogItem); virtual; abstract;
procedure TearDown; virtual; abstract; procedure TearDown; virtual;
procedure TryToRestart(var Restarted: Boolean); virtual; procedure TryToRestart(var Restarted: Boolean); virtual;
procedure SetLogLevel(const Value: TLogType); procedure SetLogLevel(const Value: TLogType);
function GetLogLevel: TLogType; inline; 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 GetDefaultFormatSettings: TFormatSettings;
function StringToLogType(const aLogType: string): TLogType; function StringToLogType(const aLogType: string): TLogType;
function BuildLogWriter(aAppenders: array of ILogAppender; aEventsHandlers: TLoggerProEventsHandler = nil; function BuildLogWriter(aAppenders: array of ILogAppender; aEventsHandlers: TLoggerProEventsHandler = nil;
aLogLevel: TLogType = TLogType.Debug): ILogWriter; aLogLevel: TLogType = TLogType.Debug): ILogWriter;
function LogLayoutByPlaceHoldersToLogLayoutByIndexes(const LogLayoutByPlaceHolders: String): String; function LogLayoutByPlaceHoldersToLogLayoutByIndexes(const LogLayoutByPlaceHolders: String; const UseZeroBasedIncrementalIndexes: Boolean): String;
implementation implementation
@ -389,7 +387,8 @@ uses
LoggerPro.FileAppender, LoggerPro.FileAppender,
System.SyncObjs, System.SyncObjs,
System.DateUtils, System.DateUtils,
System.IOUtils; System.IOUtils,
LoggerPro.Renderers;
function GetDefaultFormatSettings: TFormatSettings; function GetDefaultFormatSettings: TFormatSettings;
begin begin
@ -400,7 +399,7 @@ begin
Result.ShortTimeFormat := 'HH:NN:SS'; Result.ShortTimeFormat := 'HH:NN:SS';
end; end;
function LogLayoutByPlaceHoldersToLogLayoutByIndexes(const LogLayoutByPlaceHolders: String): String; function LogLayoutByPlaceHoldersToLogLayoutByIndexes(const LogLayoutByPlaceHolders: String; const UseZeroBasedIncrementalIndexes: Boolean): String;
var var
PlaceHolders, PlaceHolderWidthsAndPaddings: TArray<string>; PlaceHolders, PlaceHolderWidthsAndPaddings: TArray<string>;
I: Integer; I: Integer;
@ -437,6 +436,24 @@ begin
PlaceHolderWidthsAndPaddings[4] := ''; PlaceHolderWidthsAndPaddings[4] := '';
Result := LogLayoutByPlaceHolders; Result := LogLayoutByPlaceHolders;
if UseZeroBasedIncrementalIndexes then
begin
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 for I := 0 to High(PlaceHolders) do
begin begin
Result := Result.Replace( Result := Result.Replace(
@ -444,6 +461,7 @@ begin
'%' + IntToStr(I) + ':' + PlaceHolderWidthsAndPaddings[I] + 's'); '%' + IntToStr(I) + ':' + PlaceHolderWidthsAndPaddings[I] + 's');
end; end;
end; end;
end;
function StringToLogType(const aLogType: string): TLogType; function StringToLogType(const aLogType: string): TLogType;
var var
@ -870,40 +888,32 @@ end;
{ TLoggerProAppenderBase } { TLoggerProAppenderBase }
constructor TLoggerProAppenderBase.Create(ALogLayout: string); constructor TLoggerProAppenderBase.Create(aLogItemRenderer: ILogItemRenderer);
begin begin
inherited Create; inherited Create;
Self.FEnabled := true; Self.FEnabled := true;
Self.FLogLevel := TLogType.Debug; 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; Self.FOnLogRow := nil;
end; end;
function TLoggerProAppenderBase.FormatLog(const ALogItem: TLogItem): string; function TLoggerProAppenderBase.FormatLog(const ALogItem: TLogItem): string;
begin begin
if Assigned(FOnLogRow) then if Assigned(FOnLogRow) then
FOnLogRow(ALogItem, Result) begin
FOnLogRow(ALogItem, Result);
end
else else
begin begin
Result := Format(FLogFormat, [ Result := FLogItemRenderer.RenderLogItem(ALogItem);
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
// ]);
end; end;
end; end;
function TLoggerProAppenderBase.GetLastErrorTimeStamp: TDateTime; function TLoggerProAppenderBase.GetLastErrorTimeStamp: TDateTime;
@ -929,6 +939,12 @@ end;
procedure TLoggerProAppenderBase.Setup; procedure TLoggerProAppenderBase.Setup;
begin begin
FFormatSettings := GetDefaultFormatSettings; FFormatSettings := GetDefaultFormatSettings;
FLogItemRenderer.Setup;
end;
procedure TLoggerProAppenderBase.TearDown;
begin
FLogItemRenderer.TearDown;
end; end;
procedure TLoggerProAppenderBase.TryToRestart(var Restarted: Boolean); procedure TLoggerProAppenderBase.TryToRestart(var Restarted: Boolean);
@ -1075,5 +1091,18 @@ begin
Result := inherited; Result := inherited;
end; end;
{ TLogItemRenderer }
procedure TLogItemRenderer.Setup;
begin
// do nothing
end;
procedure TLogItemRenderer.TearDown;
begin
// do nothing
end;
end. end.

View File

@ -20,10 +20,12 @@ LoggerPro is compatibile with
- Delphi XE3 - Delphi XE3
- Delphi XE2 - 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 - Delphi 12 Athens Support
- FIX https://github.com/danieleteti/loggerpro/issues/72 - FIX https://github.com/danieleteti/loggerpro/issues/72
- New LogLevel: FATAL (https://github.com/danieleteti/loggerpro/issues/80) - 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) ## What's new in 1.4.0 (stable version)

View File

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

View File

@ -123,6 +123,7 @@
<DCCReference Include="..\..\LoggerPro.Utils.pas"/> <DCCReference Include="..\..\LoggerPro.Utils.pas"/>
<DCCReference Include="..\..\ThreadSafeQueueU.pas"/> <DCCReference Include="..\..\ThreadSafeQueueU.pas"/>
<DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/> <DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<BuildConfiguration Include="Base"> <BuildConfiguration Include="Base">
<Key>Base</Key> <Key>Base</Key>
</BuildConfiguration> </BuildConfiguration>
@ -170,6 +171,12 @@
</DeployFile> </DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx64\libcgsqlite3.dylib" Class="DependencyModule"/> <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\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"> <DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32"> <Platform Name="OSX32">
<Operation>1</Operation> <Operation>1</Operation>

View File

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

View File

@ -123,6 +123,7 @@
<DCCReference Include="..\..\LoggerPro.Utils.pas"/> <DCCReference Include="..\..\LoggerPro.Utils.pas"/>
<DCCReference Include="..\..\ThreadSafeQueueU.pas"/> <DCCReference Include="..\..\ThreadSafeQueueU.pas"/>
<DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/> <DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<BuildConfiguration Include="Base"> <BuildConfiguration Include="Base">
<Key>Base</Key> <Key>Base</Key>
</BuildConfiguration> </BuildConfiguration>
@ -171,6 +172,12 @@
</DeployFile> </DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx64\libcgsqlite3.dylib" Class="DependencyModule"/> <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\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"> <DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32"> <Platform Name="OSX32">
<Operation>1</Operation> <Operation>1</Operation>

View File

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

View File

@ -123,6 +123,7 @@
<DCCReference Include="..\..\LoggerPro.Utils.pas"/> <DCCReference Include="..\..\LoggerPro.Utils.pas"/>
<DCCReference Include="..\..\ThreadSafeQueueU.pas"/> <DCCReference Include="..\..\ThreadSafeQueueU.pas"/>
<DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/> <DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<BuildConfiguration Include="Base"> <BuildConfiguration Include="Base">
<Key>Base</Key> <Key>Base</Key>
</BuildConfiguration> </BuildConfiguration>
@ -170,6 +171,12 @@
</DeployFile> </DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx64\libcgsqlite3.dylib" Class="DependencyModule"/> <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\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"> <DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32"> <Platform Name="OSX32">
<Operation>1</Operation> <Operation>1</Operation>

View File

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

View File

@ -120,6 +120,7 @@
<DCCReference Include="..\..\LoggerPro.Utils.pas"/> <DCCReference Include="..\..\LoggerPro.Utils.pas"/>
<DCCReference Include="..\..\ThreadSafeQueueU.pas"/> <DCCReference Include="..\..\ThreadSafeQueueU.pas"/>
<DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/> <DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<BuildConfiguration Include="Base"> <BuildConfiguration Include="Base">
<Key>Base</Key> <Key>Base</Key>
</BuildConfiguration> </BuildConfiguration>
@ -167,6 +168,12 @@
</DeployFile> </DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx64\libcgsqlite3.dylib" Class="DependencyModule"/> <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\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"> <DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32"> <Platform Name="OSX32">
<Operation>1</Operation> <Operation>1</Operation>

View File

@ -49,6 +49,8 @@ contains
LoggerPro.UDPSyslogAppender in '..\..\LoggerPro.UDPSyslogAppender.pas', LoggerPro.UDPSyslogAppender in '..\..\LoggerPro.UDPSyslogAppender.pas',
LoggerPro.Utils in '..\..\LoggerPro.Utils.pas', LoggerPro.Utils in '..\..\LoggerPro.Utils.pas',
ThreadSafeQueueU in '..\..\ThreadSafeQueueU.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. end.

View File

@ -123,6 +123,8 @@
<DCCReference Include="..\..\LoggerPro.Utils.pas"/> <DCCReference Include="..\..\LoggerPro.Utils.pas"/>
<DCCReference Include="..\..\ThreadSafeQueueU.pas"/> <DCCReference Include="..\..\ThreadSafeQueueU.pas"/>
<DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/> <DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<DCCReference Include="..\..\LoggerPro.ConsoleAppender.pas"/>
<BuildConfiguration Include="Base"> <BuildConfiguration Include="Base">
<Key>Base</Key> <Key>Base</Key>
</BuildConfiguration> </BuildConfiguration>
@ -167,6 +169,12 @@
</DeployFile> </DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx64\libcgsqlite3.dylib" Class="DependencyModule"/> <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\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"> <DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32"> <Platform Name="OSX32">
<Operation>1</Operation> <Operation>1</Operation>

View File

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

View File

@ -122,6 +122,7 @@
<DCCReference Include="..\..\LoggerPro.Utils.pas"/> <DCCReference Include="..\..\LoggerPro.Utils.pas"/>
<DCCReference Include="..\..\ThreadSafeQueueU.pas"/> <DCCReference Include="..\..\ThreadSafeQueueU.pas"/>
<DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/> <DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<BuildConfiguration Include="Base"> <BuildConfiguration Include="Base">
<Key>Base</Key> <Key>Base</Key>
</BuildConfiguration> </BuildConfiguration>
@ -168,6 +169,12 @@
</DeployFile> </DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx64\libcgsqlite3.dylib" Class="DependencyModule"/> <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\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"> <DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32"> <Platform Name="OSX32">
<Operation>1</Operation> <Operation>1</Operation>

View File

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

View File

@ -123,6 +123,7 @@
<DCCReference Include="..\..\LoggerPro.Utils.pas"/> <DCCReference Include="..\..\LoggerPro.Utils.pas"/>
<DCCReference Include="..\..\ThreadSafeQueueU.pas"/> <DCCReference Include="..\..\ThreadSafeQueueU.pas"/>
<DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/> <DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<BuildConfiguration Include="Base"> <BuildConfiguration Include="Base">
<Key>Base</Key> <Key>Base</Key>
</BuildConfiguration> </BuildConfiguration>
@ -167,6 +168,12 @@
</DeployFile> </DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx64\libcgsqlite3.dylib" Class="DependencyModule"/> <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\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"> <DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32"> <Platform Name="OSX32">
<Operation>1</Operation> <Operation>1</Operation>
@ -558,6 +565,127 @@
<Operation>0</Operation> <Operation>0</Operation>
</Platform> </Platform>
</DeployClass> </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"> <DeployClass Name="iOS_AppStore1024">
<Platform Name="iOSDevice64"> <Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir> <RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
@ -758,127 +886,6 @@
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
</DeployClass> </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="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/> <ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/> <ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>

View File

@ -49,6 +49,8 @@ contains
LoggerPro.UDPSyslogAppender in '..\..\LoggerPro.UDPSyslogAppender.pas', LoggerPro.UDPSyslogAppender in '..\..\LoggerPro.UDPSyslogAppender.pas',
LoggerPro.Utils in '..\..\LoggerPro.Utils.pas', LoggerPro.Utils in '..\..\LoggerPro.Utils.pas',
ThreadSafeQueueU in '..\..\ThreadSafeQueueU.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. end.

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<ProjectGuid>{1611FBE6-5266-48FE-BDF5-E46EEAA922BE}</ProjectGuid> <ProjectGuid>{1611FBE6-5266-48FE-BDF5-E46EEAA922BE}</ProjectGuid>
<MainSource>loggerproRT.dpk</MainSource> <MainSource>loggerproRT.dpk</MainSource>
<ProjectVersion>19.5</ProjectVersion> <ProjectVersion>20.1</ProjectVersion>
<FrameworkType>None</FrameworkType> <FrameworkType>None</FrameworkType>
<Base>True</Base> <Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config> <Config Condition="'$(Config)'==''">Debug</Config>
@ -62,12 +62,12 @@
<PropertyGroup Condition="'$(Base_Android)'!=''"> <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> <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> <BT_BuildType>Debug</BT_BuildType>
<EnabledSysJars>activity-1.1.0.dex.jar;annotation-1.2.0.dex.jar;appcompat-1.2.0.dex.jar;appcompat-resources-1.2.0.dex.jar;asynclayoutinflater-1.0.0.dex.jar;billing-4.0.0.dex.jar;biometric-1.1.0.dex.jar;browser-1.0.0.dex.jar;cloud-messaging.dex.jar;collection-1.1.0.dex.jar;coordinatorlayout-1.0.0.dex.jar;core-1.5.0-rc02.dex.jar;core-common-2.1.0.dex.jar;core-runtime-2.1.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;firebase-annotations-16.0.0.dex.jar;firebase-common-20.0.0.dex.jar;firebase-components-17.0.0.dex.jar;firebase-datatransport-18.0.0.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.0.0.dex.jar;firebase-installations-interop-17.0.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-22.0.0.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;legacy-support-core-ui-1.0.0.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.2.0.dex.jar;lifecycle-livedata-2.0.0.dex.jar;lifecycle-livedata-core-2.2.0.dex.jar;lifecycle-runtime-2.2.0.dex.jar;lifecycle-service-2.0.0.dex.jar;lifecycle-viewmodel-2.2.0.dex.jar;lifecycle-viewmodel-savedstate-2.2.0.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;play-services-ads-20.1.0.dex.jar;play-services-ads-base-20.1.0.dex.jar;play-services-ads-identifier-17.0.0.dex.jar;play-services-ads-lite-20.1.0.dex.jar;play-services-base-17.5.0.dex.jar;play-services-basement-17.6.0.dex.jar;play-services-cloud-messaging-16.0.0.dex.jar;play-services-drive-17.0.0.dex.jar;play-services-games-21.0.0.dex.jar;play-services-location-18.0.0.dex.jar;play-services-maps-17.0.1.dex.jar;play-services-measurement-base-18.0.0.dex.jar;play-services-measurement-sdk-api-18.0.0.dex.jar;play-services-places-placereport-17.0.0.dex.jar;play-services-stats-17.0.0.dex.jar;play-services-tasks-17.2.0.dex.jar;print-1.0.0.dex.jar;room-common-2.1.0.dex.jar;room-runtime-2.1.0.dex.jar;savedstate-1.0.0.dex.jar;slidingpanelayout-1.0.0.dex.jar;sqlite-2.0.1.dex.jar;sqlite-framework-2.0.1.dex.jar;swiperefreshlayout-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.0.0.dex.jar;transport-runtime-3.0.0.dex.jar;user-messaging-platform-1.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.1.0.dex.jar</EnabledSysJars> <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>
<PropertyGroup Condition="'$(Base_Android64)'!=''"> <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> <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> <BT_BuildType>Debug</BT_BuildType>
<EnabledSysJars>activity-1.1.0.dex.jar;annotation-1.2.0.dex.jar;appcompat-1.2.0.dex.jar;appcompat-resources-1.2.0.dex.jar;asynclayoutinflater-1.0.0.dex.jar;billing-4.0.0.dex.jar;biometric-1.1.0.dex.jar;browser-1.0.0.dex.jar;cloud-messaging.dex.jar;collection-1.1.0.dex.jar;coordinatorlayout-1.0.0.dex.jar;core-1.5.0-rc02.dex.jar;core-common-2.1.0.dex.jar;core-runtime-2.1.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;firebase-annotations-16.0.0.dex.jar;firebase-common-20.0.0.dex.jar;firebase-components-17.0.0.dex.jar;firebase-datatransport-18.0.0.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.0.0.dex.jar;firebase-installations-interop-17.0.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-22.0.0.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;legacy-support-core-ui-1.0.0.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.2.0.dex.jar;lifecycle-livedata-2.0.0.dex.jar;lifecycle-livedata-core-2.2.0.dex.jar;lifecycle-runtime-2.2.0.dex.jar;lifecycle-service-2.0.0.dex.jar;lifecycle-viewmodel-2.2.0.dex.jar;lifecycle-viewmodel-savedstate-2.2.0.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;play-services-ads-20.1.0.dex.jar;play-services-ads-base-20.1.0.dex.jar;play-services-ads-identifier-17.0.0.dex.jar;play-services-ads-lite-20.1.0.dex.jar;play-services-base-17.5.0.dex.jar;play-services-basement-17.6.0.dex.jar;play-services-cloud-messaging-16.0.0.dex.jar;play-services-drive-17.0.0.dex.jar;play-services-games-21.0.0.dex.jar;play-services-location-18.0.0.dex.jar;play-services-maps-17.0.1.dex.jar;play-services-measurement-base-18.0.0.dex.jar;play-services-measurement-sdk-api-18.0.0.dex.jar;play-services-places-placereport-17.0.0.dex.jar;play-services-stats-17.0.0.dex.jar;play-services-tasks-17.2.0.dex.jar;print-1.0.0.dex.jar;room-common-2.1.0.dex.jar;room-runtime-2.1.0.dex.jar;savedstate-1.0.0.dex.jar;slidingpanelayout-1.0.0.dex.jar;sqlite-2.0.1.dex.jar;sqlite-framework-2.0.1.dex.jar;swiperefreshlayout-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.0.0.dex.jar;transport-runtime-3.0.0.dex.jar;user-messaging-platform-1.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.1.0.dex.jar</EnabledSysJars> <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>
<PropertyGroup Condition="'$(Base_Win32)'!=''"> <PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace> <DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
@ -123,6 +123,8 @@
<DCCReference Include="..\..\LoggerPro.Utils.pas"/> <DCCReference Include="..\..\LoggerPro.Utils.pas"/>
<DCCReference Include="..\..\ThreadSafeQueueU.pas"/> <DCCReference Include="..\..\ThreadSafeQueueU.pas"/>
<DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/> <DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<DCCReference Include="..\..\LoggerPro.ConsoleAppender.pas"/>
<BuildConfiguration Include="Base"> <BuildConfiguration Include="Base">
<Key>Base</Key> <Key>Base</Key>
</BuildConfiguration> </BuildConfiguration>
@ -169,6 +171,12 @@
</DeployFile> </DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx64\libcgsqlite3.dylib" Class="DependencyModule"/> <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\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"> <DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32"> <Platform Name="OSX32">
<Operation>1</Operation> <Operation>1</Operation>

View File

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

View File

@ -126,6 +126,7 @@
<DCCReference Include="..\..\LoggerPro.Utils.pas"/> <DCCReference Include="..\..\LoggerPro.Utils.pas"/>
<DCCReference Include="..\..\ThreadSafeQueueU.pas"/> <DCCReference Include="..\..\ThreadSafeQueueU.pas"/>
<DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/> <DCCReference Include="..\..\LoggerPro.OutputDebugStringAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<BuildConfiguration Include="Base"> <BuildConfiguration Include="Base">
<Key>Base</Key> <Key>Base</Key>
</BuildConfiguration> </BuildConfiguration>
@ -170,6 +171,12 @@
</DeployFile> </DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx64\libcgsqlite3.dylib" Class="DependencyModule"/> <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\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"> <DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32"> <Platform Name="OSX32">
<Operation>1</Operation> <Operation>1</Operation>

View File

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

View File

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

View File

@ -135,6 +135,7 @@
<Form>MainForm</Form> <Form>MainForm</Form>
<FormType>dfm</FormType> <FormType>dfm</FormType>
</DCCReference> </DCCReference>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<BuildConfiguration Include="Base"> <BuildConfiguration Include="Base">
<Key>Base</Key> <Key>Base</Key>
</BuildConfiguration> </BuildConfiguration>
@ -162,6 +163,18 @@
</Delphi.Personality> </Delphi.Personality>
<Deployment Version="4"> <Deployment Version="4">
<DeployFile LocalName="Win32\Debug\file_appender.exe" Configuration="Debug" Class="ProjectOutput"/> <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"> <DeployClass Name="AdditionalDebugSymbols">
<Platform Name="iOSSimulator"> <Platform Name="iOSSimulator">
<Operation>1</Operation> <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'; // Create up to 10 logs in the exe\logs folder, max 2MiB each, using DEFAULT_FILENAME_FORMAT = '{module}.{number}.log';
_Log := BuildLogWriter([ _Log := BuildLogWriter([
TLoggerProSimpleFileAppender.Create(10, 2048, 'logs', TLoggerProSimpleFileAppender.Create(10, 2048, 'logs')
'{module}.{pid}.{number}.log',
TLogLayout.LOG_LAYOUT_0)
]); ]);
end. end.

View File

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

View File

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

View File

@ -127,6 +127,7 @@
<DCCReference Include="..\..\LoggerPro.JSONLFileAppender.pas"/> <DCCReference Include="..\..\LoggerPro.JSONLFileAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.FileAppender.pas"/> <DCCReference Include="..\..\LoggerPro.FileAppender.pas"/>
<DCCReference Include="..\..\LoggerPro.pas"/> <DCCReference Include="..\..\LoggerPro.pas"/>
<DCCReference Include="..\..\LoggerPro.Renderers.pas"/>
<BuildConfiguration Include="Base"> <BuildConfiguration Include="Base">
<Key>Base</Key> <Key>Base</Key>
</BuildConfiguration> </BuildConfiguration>
@ -159,7 +160,7 @@
<Platform value="Win64">False</Platform> <Platform value="Win64">False</Platform>
</Platforms> </Platforms>
<Deployment Version="4"> <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"> <Platform Name="Win32">
<RemoteName>jsonl_appender.exe</RemoteName> <RemoteName>jsonl_appender.exe</RemoteName>
<Overwrite>true</Overwrite> <Overwrite>true</Overwrite>

View File

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

View File

@ -36,22 +36,22 @@
<Projects Include="100_udp_syslog\udp_syslog.dproj"> <Projects Include="100_udp_syslog\udp_syslog.dproj">
<Dependencies/> <Dependencies/>
</Projects> </Projects>
<Projects Include="110_rest_appender\RESTAppenderSample.dproj"> <Projects Include="08_email_appender\email_appender.dproj">
<Dependencies/>
</Projects>
<Projects Include="110_rest_appender_mobile\RESTAppenderMobileSample.dproj">
<Dependencies/>
</Projects>
<Projects Include="rest_logs_collector\RESTLogsCollector.dproj">
<Dependencies/> <Dependencies/>
</Projects> </Projects>
<Projects Include="90_remote_logging_with_redis\REDISAppenderSample.dproj"> <Projects Include="90_remote_logging_with_redis\REDISAppenderSample.dproj">
<Dependencies/> <Dependencies/>
</Projects> </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"> <Projects Include="90_remote_logging_with_redis\redis_logs_viewer\RedisLogsViewer.dproj">
<Dependencies/> <Dependencies/>
</Projects> </Projects>
<Projects Include="08_email_appender\email_appender.dproj"> <Projects Include="110_rest_appender_mobile\RESTAppenderMobileSample.dproj">
<Dependencies/> <Dependencies/>
</Projects> </Projects>
</ItemGroup> </ItemGroup>
@ -161,32 +161,14 @@
<Target Name="udp_syslog:Make"> <Target Name="udp_syslog:Make">
<MSBuild Projects="100_udp_syslog\udp_syslog.dproj" Targets="Make"/> <MSBuild Projects="100_udp_syslog\udp_syslog.dproj" Targets="Make"/>
</Target> </Target>
<Target Name="RESTAppenderSample"> <Target Name="email_appender">
<MSBuild Projects="110_rest_appender\RESTAppenderSample.dproj"/> <MSBuild Projects="08_email_appender\email_appender.dproj"/>
</Target> </Target>
<Target Name="RESTAppenderSample:Clean"> <Target Name="email_appender:Clean">
<MSBuild Projects="110_rest_appender\RESTAppenderSample.dproj" Targets="Clean"/> <MSBuild Projects="08_email_appender\email_appender.dproj" Targets="Clean"/>
</Target> </Target>
<Target Name="RESTAppenderSample:Make"> <Target Name="email_appender:Make">
<MSBuild Projects="110_rest_appender\RESTAppenderSample.dproj" Targets="Make"/> <MSBuild Projects="08_email_appender\email_appender.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> </Target>
<Target Name="REDISAppenderSample"> <Target Name="REDISAppenderSample">
<MSBuild Projects="90_remote_logging_with_redis\REDISAppenderSample.dproj"/> <MSBuild Projects="90_remote_logging_with_redis\REDISAppenderSample.dproj"/>
@ -197,6 +179,24 @@
<Target Name="REDISAppenderSample:Make"> <Target Name="REDISAppenderSample:Make">
<MSBuild Projects="90_remote_logging_with_redis\REDISAppenderSample.dproj" Targets="Make"/> <MSBuild Projects="90_remote_logging_with_redis\REDISAppenderSample.dproj" Targets="Make"/>
</Target> </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"> <Target Name="RedisLogsViewer">
<MSBuild Projects="90_remote_logging_with_redis\redis_logs_viewer\RedisLogsViewer.dproj"/> <MSBuild Projects="90_remote_logging_with_redis\redis_logs_viewer\RedisLogsViewer.dproj"/>
</Target> </Target>
@ -206,23 +206,23 @@
<Target Name="RedisLogsViewer:Make"> <Target Name="RedisLogsViewer:Make">
<MSBuild Projects="90_remote_logging_with_redis\redis_logs_viewer\RedisLogsViewer.dproj" Targets="Make"/> <MSBuild Projects="90_remote_logging_with_redis\redis_logs_viewer\RedisLogsViewer.dproj" Targets="Make"/>
</Target> </Target>
<Target Name="email_appender"> <Target Name="RESTAppenderMobileSample">
<MSBuild Projects="08_email_appender\email_appender.dproj"/> <MSBuild Projects="110_rest_appender_mobile\RESTAppenderMobileSample.dproj"/>
</Target> </Target>
<Target Name="email_appender:Clean"> <Target Name="RESTAppenderMobileSample:Clean">
<MSBuild Projects="08_email_appender\email_appender.dproj" Targets="Clean"/> <MSBuild Projects="110_rest_appender_mobile\RESTAppenderMobileSample.dproj" Targets="Clean"/>
</Target> </Target>
<Target Name="email_appender:Make"> <Target Name="RESTAppenderMobileSample:Make">
<MSBuild Projects="08_email_appender\email_appender.dproj" Targets="Make"/> <MSBuild Projects="110_rest_appender_mobile\RESTAppenderMobileSample.dproj" Targets="Make"/>
</Target> </Target>
<Target Name="Build"> <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>
<Target Name="Clean"> <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>
<Target Name="Make"> <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> </Target>
<Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/> <Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/>
</Project> </Project>

View File

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

View File

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