Log
property Log: TvxLog read;
Example
procedure RecordSQLContext(const Data: TvxDBDef);
begin
if Data.Log <> nil then
Data.Log.LogSQLComment('Preparing data-definition work');
end;
Usage
resolves on first access the live Velox log from a parent or owner, a system-log override, or a newly owned private log.
- Treat the result as a borrowed live object unless you created the owning object and understand its private-log path; never free it from a script.
- Do not retain it across owner/parent changes, resets or teardown.
- Logging mutates execution status/history and can cause database, notification or UI effects through the
TvxLogoperation.
Additional Technical Info
Log returns the live TvxLog associated with a Velox object. Reading it is lazy and may resolve or construct state; it is not a passive stored-field read.
Source-backed resolution order
When no cached log exists, TvxLogRelative.GetLog uses this order:
- the
Logof aTvxLogRelativeparent; - the
Logof aTvxLogRelativecomponent owner; - the global system log when the concrete class overrides
UseSystemLog=True; or - a new
TvxLogowned by this object, with itsTestvalue copied from the current object.
A TvxLog object returns itself. The resolved object is cached and registered for free notification. Changing parent or owner clears the cache. A privately created log is freed by this object; a borrowed parent/owner/system log is not. If a borrowed log is destroyed, notification clears the reference and a later read resolves again.
The source comment says this getter always returns a log, but a system-log override can still yield nil if the global system log has not been assigned. Allocation, recursive resolution and log construction can also raise. The nil check in the example is therefore intentional.
Related entries
Testsupplies the test context copied into a newly created private log.TvxLogdocuments the returned class.LogSQLCommentis the operation used by the example.