matthew_morgan's avatar
matthew_morgan
Occasional Contributor
10 years ago
Status:
New Idea

Being able to change the log attributes on an existing log item (specifically a folder)

I am trying to change the attributes on a folder based on if there are any error messages within that folder. I was wondering if this was possible.  For example:

 

[code]

var goodAttr = Log.CreateNewAttributes();

goodAttr.Bold = true;
goodAttr.BackColor = clLime;
goodAttr.FontColor = clGreen;

 

var badAttr = Log.CreateNewAttributes();

badAttr .Bold = true;
badAttr .BackColor = clRed;
badAttr .FontColor = clMaroon;

 

foo = function()

{

    var previousErrs = Log.ErrCount;

 

    var logFolder = Log.CreateFolder("New Folder", "Stuff that goes in this folder", pmNormal, goodAttr);
    Log.PushLogFolder(logFolder);

 

    // ...

    // Do Stuff

    // Some of which may be errors

    //...

 

    if (Log.ErrCount > previousErrs)

    {

        // This is the part I can't figure out.

        Log.Item(logFolder).Attr = BadAttr;

    }

    Log.PopLogFolder();

}

[/code]