Is it possible to increase the logging information in Test Complete
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yep. You can modify it in all sorts of way.
https://support.smartbear.com/testcomplete/docs/testing-with/log/posting/messages.html
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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")
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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(MessageText, AdditionalInformation, Priority, Attr, Picture, FolderID)
this will not give me the information automatically. It will only give me the option to specify it. Or am I missing something? 🙂
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).
/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
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
/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
================================
