LogAttributes Object

Applies to TestComplete 14.0, last modified on January 23, 2019

Description

The LogAttributes object is used to store font and color settings that can be applied to messages and folders in the Test Log. This object is passed as the Attr parameter to the Log.CreateFolder, Log.Error, Log.Warning, Log.Message, Log.Event, Log.Picture, Log.File and Log.Link methods.

To create a LogAttributes object, call the CreateNewAttributes method of the Log object. Once the LogAttributes object is created, its properties are populated with default font and color settings accordingly.

Members

Example

JavaScript, JScript

function LogAttributes()
{
  // Specifies new attributes
  var attr = Log.CreateNewAttributes();
  attr.Bold = true;
  attr.Italic = true;
  // ...
  // Applies these attributes to a message
  Log.Message("My Text", "", pmNormal, attr);
}

Python

def LogAttributes():
  # Specifies new attributes
  attr = Log.CreateNewAttributes()
  attr.Bold = True
  attr.Italic = True
  # ...
  # Applies these attributes to a message
  Log.Message("My Text", "", pmNormal, attr)

VBScript

Sub LogAttributes()
  ' Specifies new attributes
  Set attr = Log.CreateNewAttributes
  attr.Bold = true
  attr.Italic = true
  ' ...
  ' Applies these attributes to a message
  Call Log.Message("My Text", "", pmNormal, attr)
End Sub

DelphiScript

function LogAttributes;
var attr;
begin

  // Specifies new attributes
  attr := Log.CreateNewAttributes;
  attr.Bold := true;
  attr.Italic := true;
  // ...
  // Applies these attributes to a message
  Log.Message('My Text', '', pmNormal, attr);

end;

C++Script, C#Script

function LogAttributes()
{
  // Specifies new attributes
  var attr = Log["CreateNewAttributes"]();
  attr["Bold"] = true;
  attr["Italic"] = true;
  // ...
  // Applies these attributes to a message
  Log["Message"]("My Text", "", pmNormal, attr);
}

See Also

Test Log
Log Object

Highlight search results