Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

LogDataSet causing Log Entry = Internal Error which causing log flush


#1

Good day,

We have following setting in MyApp.sic :

Connections = file(append="true", filename="MyApp.sil", rotate="daily", backlog.enabled="true"), pipe() DefaultLevel = Debug Enabled = True Level = Debug

We use backlog.enabled to avoid any logging unless error detected.

This is what happens when we try to log empty dataset:

Looks like LogDataSet generates Internal Error entry which causing log being saved to the disk.

Thank you,
Alex


#2

Hello Alex,

Yes, this is indeed the case. LogDataSet generates an internal error for this because an empty data set is special and this behavior quickly shows you empty data sets in the log. If this behavior is not wanted, you can check the data set for emptiness before calling LogDataSet:

if ADataSet.FieldDefList.Count > 0 then begin SiMain.LogDataSet(.., ADataSet, ..); end;

You could also put this in a custom log method if you are using this code snippet often.

Regards,
Tobias