Class XmlLogger
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
trueto 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
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
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
levelReportLevelThe message level.
categorystringThe category name.
messagestringAn optional message for the data.
dataobjectThe message data object.
metaInfosIDictionary<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
levelReportLevelThe message level.
categorystringThe category name.
messagestringThe message text.
escapeboolText escaping flag.
metaInfosIDictionary<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
xslFileContentstringContent 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
xslFileNamestringThe name of the XSL file.
Start()
Starts the logger.
public void Start()