Forum Discussion

Fredrik's avatar
Fredrik
Occasional Contributor
8 years ago
Solved

Is it possible to increase the logging information in Test Complete

Hi, 

I was wondering if there are any way to add information to the logfile e.g. from where the log printout is posted from (file/function)? Now, I have type, message, time priority, link, picture and type description. 

 

Thanks! 

  • Hi,

     

    > Log.Message("Temp: Hello")

    No, this is not possible for VBScript and DelphiScript.

    There were threads here that provided code samples of how this (to some extent?) can be done with JScript. I believe that the same can be done with JavaScript as well.

9 Replies

  • Bobik's avatar
    Bobik
    Frequent Contributor

    You can try enable Call stack info for needed message types. But it definitely will slow down your tests playback performance.

    Log.CallStackSettings.EnableStackOnEvent = true;
    Log.CallStackSettings.EnableStackOnMessage = true;

     

    • Fredrik's avatar
      Fredrik
      Occasional Contributor

      Thanks for the info. 

       

      1. Using the enable stack on Event might work to some extent, I'm more interested in the method and not the whole call stack. :) 

       

      2. Log.Message(MessageTextAdditionalInformationPriorityAttrPictureFolderID)
      this will not give me the information automatically. It will only give me the option to specify it. Or am I missing something? :) 

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Not sure if I got the question right... but if you double-click log message in TestComplete, you will be navigated to the code line that posted this message. Whether or not call information on the Call Stack pane is available depends on whether or not CallStackSettings is enabled for the given message type (as others already have mentioned).

    • Fredrik's avatar
      Fredrik
      Occasional Contributor

      Hi again! 

       

      So basically I would like to know from what method the log print is generated from. 

       

      If I have a routine like: 

       

      Sub Temp

           Log.Message("Hello")

      End Temp

       

      Is it possible with some project setting to add details of where the print is generated from e.g.  in this case it is generated from the routine Temp. Of course I can add the information manually to the printouts but is there any automatic way to do this (Log.Message("Temp: Hello"))

       

      Thanks! 

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        > Log.Message("Temp: Hello")

        No, this is not possible for VBScript and DelphiScript.

        There were threads here that provided code samples of how this (to some extent?) can be done with JScript. I believe that the same can be done with JavaScript as well.

  • Manfred_F's avatar
    Manfred_F
    Regular Contributor

    You can add the module and Routine Name as last paragraph in "additional data".

    Give a naming constant to each module and every Routine, then You can do it.

     

    For System Routines, I Hand in the caller's Name as a Parameter, so I can see where an item really Comes from.

    The call stack won't work for script extensions.