Table of Contents

Class XmlLogger

Namespace
Ranorex.Core
Assembly
Ranorex.Core.dll

The standard Ranorex XML-logger for 2.X projects.

public class XmlLogger : IReportLogger
Inheritance
XmlLogger
Implements
Inherited Members

Constructors

XmlLogger()

Initializes a new instance of the XmlLogger class.

public XmlLogger()

Properties

AppendExisting

Gets or sets a value indicating whether log entries should be appended to an already existing logfile, or if it should be overwritten.

public static bool AppendExisting { get; set; }

Property Value

bool

true to append to an existing file; otherwise, false.

DefaultLogFileName

Gets the default name of the XML log file.

public static string DefaultLogFileName { get; }

Property Value

string

The default name of the log file.

LogFileName

Gets or sets the log file name.

public static string LogFileName { get; set; }

Property Value

string

The default name of the file.

PreFilterMessages

Determines whether the logger is called for all log message or only for messages whose report level is greater or equal than the currently set report level.

public bool PreFilterMessages { get; }

Property Value

bool

RanorexReportXsl

The stylesheet used for formatting XML log files. For internal use only.

public static byte[] RanorexReportXsl { get; }

Property Value

byte[]

The ranorex report XSL.

ReportStylesheetUrl

Gets or sets the URL to the XSL stylesheet used for rendering the XML report; you can use an XSL stylesheet stored on a network share (file://pathToFile) or in the intranet/Internet (http://pathToStylesheet).

public static string ReportStylesheetUrl { get; set; }

Property Value

string

Title

Gets or sets the title to use for the XML report file.

public static string Title { get; set; }

Property Value

string

The title string for report.

Remarks

The default title is Ranorex Test Report

Methods

End()

Ends logging. Should free all resources.

public void End()

LogData(ReportLevel, string, string, object, IDictionary<string, string>)

Logs a data message.

public void LogData(ReportLevel level, string category, string message, object data, IDictionary<string, string> metaInfos)

Parameters

level ReportLevel

The message level.

category string

The category name.

message string

An optional message for the data.

data object

The message data object.

metaInfos IDictionary<string, string>

Advanced reference information for use in the report.

LogText(ReportLevel, string, string, bool, IDictionary<string, string>)

Logs a text message.

public void LogText(ReportLevel level, string category, string message, bool escape, IDictionary<string, string> metaInfos)

Parameters

level ReportLevel

The message level.

category string

The category name.

message string

The message text.

escape bool

Text escaping flag.

metaInfos IDictionary<string, string>

Advanced reference information for use in the report.

SetReportStylesheet(string)

Sets the report XSL file content. Can be used to generate report files with custom formatting.

public static void SetReportStylesheet(string xslFileContent)

Parameters

xslFileContent string

Content of the XSL file.

SetReportStylesheetFile(string)

Sets the name of the file to load the XSL content from. Can be used to generate report files with custom formatting.

public static void SetReportStylesheetFile(string xslFileName)

Parameters

xslFileName string

The name of the XSL file.

Start()

Starts the logger.

public void Start()