I want to log any Entity-changes in a specific case using TMSLogger.
So I registered OnUpdated-Event in my MappingExplorer and log values like this:
for sCols in aArgs.ChangedColumnNames do
try
sOldValue := '';
sNewValue := '';
if aArgs.OldColumnValues.TryGetValue(sCols, hOldValue) and not VarIsEmpty(hOldValue) and not VarIsNull(hOldValue) then
sOldValue := hOldValue;
if aArgs.NewColumnValues.TryGetValue(sCols, hNewValue) and not VarIsEmpty(hNewValue) and not VarIsNull(hNewValue) then
sNewValue := hNewValue;
TMSLogger.InfoFormat('"{%s}" changed from {%s} to {%s}', [sCols, sOldValue, sNewValue]);
except
on Exception do
TMSLogger.InfoFormat('"%s" has changed, but content could not be logged', [sCols]);
end;
If I use the above given Code, some Values like:
sOldValue = '2LfdNo:5'
sNewValue = '2SeqNo:5'
sCols = 'FieldName'
will be logged like this:
[Value: "FieldName" changed from 2 to 2]
but it should be
[Value: "FieldName" changed from 2<YYYY><LfdNo:5> to 2<YYYY><SeqNo:5>]
How do I have to escape the parameters, or is this a bug?
var
hHandler: TTMSLoggerBaseOutputHandler;
begin
for hHandler in TMSLogger.OutputHandlers do // try to ensure not StripHTML, but debugger shows, it Is False...
hHandler.StripHtml := False;
TMSLogger.InfoFormat('"{%s}" check.', ['Test<abc><def>']);
TMSLogger.InfoFormat('"{%s}" <check> 2.', ['Test<abc><def>']);
end;
StripHtml works fine for TRichEditOutputHandler or TTMSLoggerTextOutputHandler but it looks like it does not work as expected in TTMSLoggerBrowserOutputHandler, or maybe Browser tries to interpret HTML...