Disabling just the console logger?

Ranorex Studio, Spy, Recorder, and Driver.
User avatar
Stub
Posts: 515
Joined: Fri Jul 15, 2016 1:35 pm

Disabling just the console logger?

Post by Stub » Thu Mar 23, 2017 3:24 pm

Is there a way in Ranorex Studio v6.2.1 to disable just the console logger?

After some poking around I discovered the Ranorex.Core.Reporting/TestReport/Setup(ReportLevel, String, Boolean) API, which lets me disable console logging. I tried calling this in my Program.cs/Main routine, but it also appears to override the reporting level and XML .rxlog output that is setup in the Test Suite properties on the Report tab.

Have I missed a trick to disabling the console window?

McTurtle
Posts: 297
Joined: Thu Feb 23, 2017 10:37 am
Location: Benedikt, Slovenia

Re: Disabling just the console logger?

Post by McTurtle » Fri Mar 24, 2017 8:50 am

Hello Stub,

I tried adding the line "TestReport.Setup(ReportLevel.Always,null,false);" to Program.cs right at the beginning of Main. Normal Ranorex XML Report in /bin/debug still gets created. Console opens, but no logging happens to the console.

I am using Ranorex 6.2.1. Can you double check if you did the same or something a bit different?

Someone else has just yesterday posted a similar question on the forum: http://www.ranorex.com/forum/viewtopic. ... 810#p42810

Regards,
McTurtle

User avatar
Stub
Posts: 515
Joined: Fri Jul 15, 2016 1:35 pm

Re: Disabling just the console logger?

Post by Stub » Fri Mar 24, 2017 11:13 am

McTurtle, you're right, setting the XML filename to null doesn't turn off XML reporting. My reading of the API documentation led me to think that it would be disabled!

Code: Select all

fileName (String)
Name of the XML log file, or null if XML logging should be disabled.
It was actually that thread you linked to that led me to this TestReport.Setup API. But when I saw the fileName parameter I thought there may be a UI option instead as I wanted to retain the Ranorex Studio XML filename formatting options.

Either way, that gets rid of the console logger which is what I was after! Thanks for trying it out for me, which I clearly failed to bother testing in the first place :D