Forum Discussion

blbdt36's avatar
blbdt36
Contributor
9 years ago

Filter out events from the log

I am planning on exporting the logs of all my tests, but it shows all the events in the test.  This is very unhelpful.  I can limit them on TestComplete, but not when exporting.  How do I show only the message types I want?

 

I tried   Log.LockEvents();  and that didn't do anything

I can't use   Log.enabled = false because that would suppress ALL logging events.  I still need the errors, but not the individual keys and clicks messages.

 

Thanks

6 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi,

     

    You can try calling Log.Enabled=false inside the OnLogEvent event handler. In this case, you will block posting all events to the Test Log. However, all other types of messages (errors, messages, etc.) will be successfully posted.

    Does it work for you?

    • blbdt36's avatar
      blbdt36
      Contributor

      As I said initially, I can't use Log.Enabled = false.  I still need to see the errors.  I don't care about the events.

      • ashokkumareds's avatar
        ashokkumareds
        Contributor

        Hi,

         

        what tanya means it include the Log.Enabled=false inside the OnLogEvent event.

        i.e. use below

         

        function GeneralEvents_OnLogEvent(Sender, LogParams){
            Log.Enabled = false;
        }

         

        This should work for you. This can also be made sure like 

         

        function GeneralEvents_OnLogEvent(Sender, LogParams){
            Log.Enabled = false;
        }

        function GeneralEvents_OnLogMessage(Sender, LogParams){
            Log.Enabled = true;
        }

         

        hope this helped