Ask a Question

Is it possible to increase the logging information in Test Complete

SOLVED
Fredrik
Occasional Contributor

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! 

9 REPLIES 9
Colin_McCrae
Community Hero

Fredrik
Occasional Contributor

Thanks! 

 

To specify the question is it possible to get that information automatically with just writing log.message("hello"). If I read the link correct, it is possible to have add information like log.message("hello", "extra information")

Pretty much.

 

It breaks down the Message method here:

 

https://support.smartbear.com/testcomplete/docs/reference/project-objects/test-log/log/message.html

 

Just have a play around with it.

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
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
Community Hero

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

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
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! 

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.

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.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
cancel
Showing results for 
Search instead for 
Did you mean: