matthew_morgan's avatar
Occasional Contributor
10 years ago
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:



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);


    // ...

    // 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;