diff --git a/lib/loggerpro/LoggerPro.EMailAppender.pas b/lib/loggerpro/LoggerPro.EMailAppender.pas index 7a1854ff..5d4280c9 100644 --- a/lib/loggerpro/LoggerPro.EMailAppender.pas +++ b/lib/loggerpro/LoggerPro.EMailAppender.pas @@ -48,7 +48,7 @@ type /// 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; diff --git a/lib/loggerpro/LoggerPro.FileAppender.pas b/lib/loggerpro/LoggerPro.FileAppender.pas index 90cb2248..399931ce 100644 --- a/lib/loggerpro/LoggerPro.FileAppender.pas +++ b/lib/loggerpro/LoggerPro.FileAppender.pas @@ -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; diff --git a/lib/loggerpro/LoggerPro.JSONLFileAppender.pas b/lib/loggerpro/LoggerPro.JSONLFileAppender.pas index 9e00bc6c..986e1cb8 100644 --- a/lib/loggerpro/LoggerPro.JSONLFileAppender.pas +++ b/lib/loggerpro/LoggerPro.JSONLFileAppender.pas @@ -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. diff --git a/lib/loggerpro/LoggerPro.NSQAppender.pas b/lib/loggerpro/LoggerPro.NSQAppender.pas index 458e9b14..203daa59 100644 --- a/lib/loggerpro/LoggerPro.NSQAppender.pas +++ b/lib/loggerpro/LoggerPro.NSQAppender.pas @@ -109,7 +109,7 @@ type /// creation event is defined 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; diff --git a/lib/loggerpro/LoggerPro.OutputDebugStringAppender.pas b/lib/loggerpro/LoggerPro.OutputDebugStringAppender.pas index 04d3e3a9..baed3a8e 100644 --- a/lib/loggerpro/LoggerPro.OutputDebugStringAppender.pas +++ b/lib/loggerpro/LoggerPro.OutputDebugStringAppender.pas @@ -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; diff --git a/lib/loggerpro/LoggerPro.RESTAppender.pas b/lib/loggerpro/LoggerPro.RESTAppender.pas index 57dd21ad..4cc0eecd 100644 --- a/lib/loggerpro/LoggerPro.RESTAppender.pas +++ b/lib/loggerpro/LoggerPro.RESTAppender.pas @@ -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 := ''; diff --git a/lib/loggerpro/LoggerPro.RedisAppender.pas b/lib/loggerpro/LoggerPro.RedisAppender.pas index 8517a7ec..3efd5878 100644 --- a/lib/loggerpro/LoggerPro.RedisAppender.pas +++ b/lib/loggerpro/LoggerPro.RedisAppender.pas @@ -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; diff --git a/lib/loggerpro/LoggerPro.Renderers.pas b/lib/loggerpro/LoggerPro.Renderers.pas new file mode 100644 index 00000000..dadf52ae --- /dev/null +++ b/lib/loggerpro/LoggerPro.Renderers.pas @@ -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. diff --git a/lib/loggerpro/LoggerPro.SimpleConsoleAppender.pas b/lib/loggerpro/LoggerPro.SimpleConsoleAppender.pas index 2e0ffa53..1fd30920 100644 --- a/lib/loggerpro/LoggerPro.SimpleConsoleAppender.pas +++ b/lib/loggerpro/LoggerPro.SimpleConsoleAppender.pas @@ -2,7 +2,7 @@ // // LoggerPro // -// Copyright (c) 2010-2023 Daniele Teti +// Copyright (c) 2010-2024 Daniele Teti // // https://github.com/danieleteti/loggerpro // diff --git a/lib/loggerpro/LoggerPro.VCLListViewAppender.pas b/lib/loggerpro/LoggerPro.VCLListViewAppender.pas index cc8b6141..4431e0f4 100644 --- a/lib/loggerpro/LoggerPro.VCLListViewAppender.pas +++ b/lib/loggerpro/LoggerPro.VCLListViewAppender.pas @@ -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; diff --git a/lib/loggerpro/LoggerPro.VCLMemoAppender.pas b/lib/loggerpro/LoggerPro.VCLMemoAppender.pas index c89a2a29..9914cbe4 100644 --- a/lib/loggerpro/LoggerPro.VCLMemoAppender.pas +++ b/lib/loggerpro/LoggerPro.VCLMemoAppender.pas @@ -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; diff --git a/lib/loggerpro/LoggerPro.pas b/lib/loggerpro/LoggerPro.pas index cf65d851..cc64121c 100644 --- a/lib/loggerpro/LoggerPro.pas +++ b/lib/loggerpro/LoggerPro.pas @@ -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; 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. diff --git a/lib/loggerpro/README.md b/lib/loggerpro/README.md index c1b997fc..c58dfafe 100644 --- a/lib/loggerpro/README.md +++ b/lib/loggerpro/README.md @@ -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) diff --git a/lib/loggerpro/packages/d100/loggerproRT.dpk b/lib/loggerpro/packages/d100/loggerproRT.dpk index 0d9e546e..5024c61c 100644 --- a/lib/loggerpro/packages/d100/loggerproRT.dpk +++ b/lib/loggerpro/packages/d100/loggerproRT.dpk @@ -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. diff --git a/lib/loggerpro/packages/d100/loggerproRT.dproj b/lib/loggerpro/packages/d100/loggerproRT.dproj index 9491dd48..4162348e 100644 --- a/lib/loggerpro/packages/d100/loggerproRT.dproj +++ b/lib/loggerpro/packages/d100/loggerproRT.dproj @@ -123,6 +123,7 @@ + Base @@ -170,6 +171,12 @@ + + + loggerproRT.bpl + true + + 1 diff --git a/lib/loggerpro/packages/d101/loggerproRT.dpk b/lib/loggerpro/packages/d101/loggerproRT.dpk index 9ae66964..32a04769 100644 --- a/lib/loggerpro/packages/d101/loggerproRT.dpk +++ b/lib/loggerpro/packages/d101/loggerproRT.dpk @@ -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. diff --git a/lib/loggerpro/packages/d101/loggerproRT.dproj b/lib/loggerpro/packages/d101/loggerproRT.dproj index 562b9f09..3af53713 100644 --- a/lib/loggerpro/packages/d101/loggerproRT.dproj +++ b/lib/loggerpro/packages/d101/loggerproRT.dproj @@ -123,6 +123,7 @@ + Base @@ -171,6 +172,12 @@ + + + loggerproRT.bpl + true + + 1 diff --git a/lib/loggerpro/packages/d102/loggerproRT.dpk b/lib/loggerpro/packages/d102/loggerproRT.dpk index 4b6335cd..45adcfa2 100644 --- a/lib/loggerpro/packages/d102/loggerproRT.dpk +++ b/lib/loggerpro/packages/d102/loggerproRT.dpk @@ -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. diff --git a/lib/loggerpro/packages/d102/loggerproRT.dproj b/lib/loggerpro/packages/d102/loggerproRT.dproj index e2ae8619..8f6fc39b 100644 --- a/lib/loggerpro/packages/d102/loggerproRT.dproj +++ b/lib/loggerpro/packages/d102/loggerproRT.dproj @@ -123,6 +123,7 @@ + Base @@ -170,6 +171,12 @@ + + + loggerproRT.bpl + true + + 1 diff --git a/lib/loggerpro/packages/d103/loggerproRT.dpk b/lib/loggerpro/packages/d103/loggerproRT.dpk index 5198877b..b7a53140 100644 --- a/lib/loggerpro/packages/d103/loggerproRT.dpk +++ b/lib/loggerpro/packages/d103/loggerproRT.dpk @@ -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. diff --git a/lib/loggerpro/packages/d103/loggerproRT.dproj b/lib/loggerpro/packages/d103/loggerproRT.dproj index 8cd127ed..71cf0dd8 100644 --- a/lib/loggerpro/packages/d103/loggerproRT.dproj +++ b/lib/loggerpro/packages/d103/loggerproRT.dproj @@ -120,6 +120,7 @@ + Base @@ -167,6 +168,12 @@ + + + loggerproRT.bpl + true + + 1 diff --git a/lib/loggerpro/packages/d104/loggerproRT.dpk b/lib/loggerpro/packages/d104/loggerproRT.dpk index 0ea8350b..d50b439e 100644 --- a/lib/loggerpro/packages/d104/loggerproRT.dpk +++ b/lib/loggerpro/packages/d104/loggerproRT.dpk @@ -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. diff --git a/lib/loggerpro/packages/d104/loggerproRT.dproj b/lib/loggerpro/packages/d104/loggerproRT.dproj index df0d9c49..bcca69ab 100644 --- a/lib/loggerpro/packages/d104/loggerproRT.dproj +++ b/lib/loggerpro/packages/d104/loggerproRT.dproj @@ -123,6 +123,8 @@ + + Base @@ -167,6 +169,12 @@ + + + loggerproRT.bpl + true + + 1 diff --git a/lib/loggerpro/packages/d110/loggerproRT.dpk b/lib/loggerpro/packages/d110/loggerproRT.dpk index 04cc7ae0..2f85019b 100644 --- a/lib/loggerpro/packages/d110/loggerproRT.dpk +++ b/lib/loggerpro/packages/d110/loggerproRT.dpk @@ -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. diff --git a/lib/loggerpro/packages/d110/loggerproRT.dproj b/lib/loggerpro/packages/d110/loggerproRT.dproj index f5b4dd0d..862c7d84 100644 --- a/lib/loggerpro/packages/d110/loggerproRT.dproj +++ b/lib/loggerpro/packages/d110/loggerproRT.dproj @@ -122,6 +122,7 @@ + Base @@ -168,6 +169,12 @@ + + + loggerproRT.bpl + true + + 1 diff --git a/lib/loggerpro/packages/d111/loggerproRT.dpk b/lib/loggerpro/packages/d111/loggerproRT.dpk index bac39c82..8b482fbb 100644 --- a/lib/loggerpro/packages/d111/loggerproRT.dpk +++ b/lib/loggerpro/packages/d111/loggerproRT.dpk @@ -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. diff --git a/lib/loggerpro/packages/d111/loggerproRT.dproj b/lib/loggerpro/packages/d111/loggerproRT.dproj index e20e10b5..e7f7fe63 100644 --- a/lib/loggerpro/packages/d111/loggerproRT.dproj +++ b/lib/loggerpro/packages/d111/loggerproRT.dproj @@ -123,6 +123,7 @@ + Base @@ -167,6 +168,12 @@ + + + loggerproRT.bpl + true + + 1 @@ -558,6 +565,127 @@ 0 + + + 1 + + + 1 + + + + + + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + + + + 1 + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset @@ -758,127 +886,6 @@ 1 - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF - 1 - - - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF - 1 - - - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF - 1 - - - - - - - - 1 - - - 1 - - - 1 - - - - - - - - Contents\Resources - 1 - - - Contents\Resources - 1 - - - Contents\Resources - 1 - - - - - library\lib\armeabi-v7a - 1 - - - library\lib\arm64-v8a - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - 0 - - - - - library\lib\armeabi-v7a - 1 - - - - - 1 - - - 1 - - - - - Assets - 1 - - - Assets - 1 - - - - - Assets - 1 - - - Assets - 1 - - diff --git a/lib/loggerpro/packages/d113/loggerproRT.dpk b/lib/loggerpro/packages/d113/loggerproRT.dpk index e73a171d..0297bbc5 100644 --- a/lib/loggerpro/packages/d113/loggerproRT.dpk +++ b/lib/loggerpro/packages/d113/loggerproRT.dpk @@ -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. diff --git a/lib/loggerpro/packages/d113/loggerproRT.dproj b/lib/loggerpro/packages/d113/loggerproRT.dproj index bb30347d..6bd6136e 100644 --- a/lib/loggerpro/packages/d113/loggerproRT.dproj +++ b/lib/loggerpro/packages/d113/loggerproRT.dproj @@ -2,7 +2,7 @@ {1611FBE6-5266-48FE-BDF5-E46EEAA922BE} loggerproRT.dpk - 19.5 + 20.1 None True Debug @@ -62,12 +62,12 @@ 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= Debug - 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 + 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 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= Debug - 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 + 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 Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) @@ -123,6 +123,8 @@ + + Base @@ -169,6 +171,12 @@ + + + loggerproRT.bpl + true + + 1 diff --git a/lib/loggerpro/packages/d120/loggerproRT.dpk b/lib/loggerpro/packages/d120/loggerproRT.dpk index 250481aa..02742b30 100644 --- a/lib/loggerpro/packages/d120/loggerproRT.dpk +++ b/lib/loggerpro/packages/d120/loggerproRT.dpk @@ -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. diff --git a/lib/loggerpro/packages/d120/loggerproRT.dproj b/lib/loggerpro/packages/d120/loggerproRT.dproj index 770d81ea..92714d87 100644 --- a/lib/loggerpro/packages/d120/loggerproRT.dproj +++ b/lib/loggerpro/packages/d120/loggerproRT.dproj @@ -126,6 +126,7 @@ + Base @@ -170,6 +171,12 @@ + + + loggerproRT.bpl + true + + 1 diff --git a/lib/loggerpro/samples/02_file_appender/LoggerProConfig.pas b/lib/loggerpro/samples/02_file_appender/LoggerProConfig.pas index a29cc3f5..5608b8fd 100644 --- a/lib/loggerpro/samples/02_file_appender/LoggerProConfig.pas +++ b/lib/loggerpro/samples/02_file_appender/LoggerProConfig.pas @@ -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. diff --git a/lib/loggerpro/samples/02_file_appender/file_appender.dpr b/lib/loggerpro/samples/02_file_appender/file_appender.dpr index 54903d5a..b4b8ba8f 100644 --- a/lib/loggerpro/samples/02_file_appender/file_appender.dpr +++ b/lib/loggerpro/samples/02_file_appender/file_appender.dpr @@ -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} diff --git a/lib/loggerpro/samples/02_file_appender/file_appender.dproj b/lib/loggerpro/samples/02_file_appender/file_appender.dproj index ae9cce63..7fca4db9 100644 --- a/lib/loggerpro/samples/02_file_appender/file_appender.dproj +++ b/lib/loggerpro/samples/02_file_appender/file_appender.dproj @@ -135,6 +135,7 @@
MainForm
dfm
+ Base @@ -162,6 +163,18 @@ + + + file_appender.exe + true + + + + + file_appender.rsm + true + + 1 diff --git a/lib/loggerpro/samples/02a_simple_file_appender/LoggerProConfig.pas b/lib/loggerpro/samples/02a_simple_file_appender/LoggerProConfig.pas index eaba71a0..a3a1c931 100644 --- a/lib/loggerpro/samples/02a_simple_file_appender/LoggerProConfig.pas +++ b/lib/loggerpro/samples/02a_simple_file_appender/LoggerProConfig.pas @@ -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. diff --git a/lib/loggerpro/samples/03_console_appender/LoggerProConfig.pas b/lib/loggerpro/samples/03_console_appender/LoggerProConfig.pas index 9945e769..faf76719 100644 --- a/lib/loggerpro/samples/03_console_appender/LoggerProConfig.pas +++ b/lib/loggerpro/samples/03_console_appender/LoggerProConfig.pas @@ -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; diff --git a/lib/loggerpro/samples/09_jsonl_appender/jsonl_appender.dpr b/lib/loggerpro/samples/09_jsonl_appender/jsonl_appender.dpr index b4986b33..2f8744c7 100644 --- a/lib/loggerpro/samples/09_jsonl_appender/jsonl_appender.dpr +++ b/lib/loggerpro/samples/09_jsonl_appender/jsonl_appender.dpr @@ -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} diff --git a/lib/loggerpro/samples/09_jsonl_appender/jsonl_appender.dproj b/lib/loggerpro/samples/09_jsonl_appender/jsonl_appender.dproj index a91b4585..947e8ca7 100644 --- a/lib/loggerpro/samples/09_jsonl_appender/jsonl_appender.dproj +++ b/lib/loggerpro/samples/09_jsonl_appender/jsonl_appender.dproj @@ -127,6 +127,7 @@ + Base @@ -159,7 +160,7 @@ False - + jsonl_appender.exe true diff --git a/lib/loggerpro/samples/110_rest_appender_mobile/RESTAppenderMobileSample.dproj b/lib/loggerpro/samples/110_rest_appender_mobile/RESTAppenderMobileSample.dproj index 221576bc..cf5443a2 100644 --- a/lib/loggerpro/samples/110_rest_appender_mobile/RESTAppenderMobileSample.dproj +++ b/lib/loggerpro/samples/110_rest_appender_mobile/RESTAppenderMobileSample.dproj @@ -1244,6 +1244,7 @@ True True + False True True diff --git a/lib/loggerpro/samples/90_remote_logging_with_redis/redis_logs_viewer/RedisLogsViewer.res b/lib/loggerpro/samples/90_remote_logging_with_redis/redis_logs_viewer/RedisLogsViewer.res index 1e1f221b..0fc4ee36 100644 Binary files a/lib/loggerpro/samples/90_remote_logging_with_redis/redis_logs_viewer/RedisLogsViewer.res and b/lib/loggerpro/samples/90_remote_logging_with_redis/redis_logs_viewer/RedisLogsViewer.res differ diff --git a/lib/loggerpro/samples/SampleLoggerGroup.groupproj b/lib/loggerpro/samples/SampleLoggerGroup.groupproj index 7e2d0d0a..abf2d246 100644 --- a/lib/loggerpro/samples/SampleLoggerGroup.groupproj +++ b/lib/loggerpro/samples/SampleLoggerGroup.groupproj @@ -36,22 +36,22 @@ - - - - - - - + + + + + + + - + @@ -161,32 +161,14 @@ - - + + - - + + - - - - - - - - - - - - - - - - - - - - + + @@ -197,6 +179,24 @@ + + + + + + + + + + + + + + + + + + @@ -206,23 +206,23 @@ - - + + - - + + - - + + - + - + - + diff --git a/lib/loggerpro/samples/rest_logs_collector/RESTLogsCollector.dpr b/lib/loggerpro/samples/rest_logs_collector/RESTLogsCollector.dpr index da04f995..12741375 100644 --- a/lib/loggerpro/samples/rest_logs_collector/RESTLogsCollector.dpr +++ b/lib/loggerpro/samples/rest_logs_collector/RESTLogsCollector.dpr @@ -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} diff --git a/lib/loggerpro/samples/rest_logs_collector/RESTLogsCollector.dproj b/lib/loggerpro/samples/rest_logs_collector/RESTLogsCollector.dproj index a53658fd..4b547035 100644 --- a/lib/loggerpro/samples/rest_logs_collector/RESTLogsCollector.dproj +++ b/lib/loggerpro/samples/rest_logs_collector/RESTLogsCollector.dproj @@ -132,8 +132,6 @@ TWebModule - - Base