Custom Logger

Ask general questions here.
atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Custom Logger

Post by atom » Wed Mar 10, 2010 6:24 pm

Hiya,

Am looking to implement IReportLogger for my own custom logger, I have a few questions:

- How can i only log via my own logger and not the build in ranorex logger
(i.e turn off ranorex logging, and only use my logger)

- IReportLogger seems to be missing a few methods:
- Setup
- LogHTML
- LogXML
The setup one is needed to pass say the output filename to the custom logger

Cheers

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Custom Logger

Post by Support Team » Thu Mar 11, 2010 10:34 am

Hi,

Just attach(Ranorex.AttachLogger()) and don't call the Ranorex.Setup(). After attaching your logger you only have to invoke the Ranorex.Report.Start().

The Ranorex.Setup method only creates and instantiates the Ranorex standard loggers (i.e. ConsoleLogger and XMLLogger). If you want to set e.g. the output filename for your custom logger you have to do this in your own implementation.

LogHtml and LogXML are static members of the Report class and working on all current attached report loggers. So if you implement the LogText and LogData interfaces the Report class calls your methods internally.

Regards,
Peter
Ranorex Support Team

atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Re: Custom Logger

Post by atom » Thu Mar 11, 2010 4:11 pm

cool, thanks for reply.