1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2015 Ericsson Telecom AB
3 // All rights reserved. This program and the accompanying materials
4 // are made available under the terms of the Eclipse Public License v1.0
5 // which accompanies this distribution, and is available at
6 // http://www.eclipse.org/legal/epl-v10.html
7 ///////////////////////////////////////////////////////////////////////////////
11 namespace TitanLoggerApi { class TitanLogEvent; }
13 #include "ILoggerPlugin.hh"
16 class JUnitLogger: public ILoggerPlugin
20 virtual ~JUnitLogger();
21 inline bool is_static() { return false; }
22 void init(const char *options = 0);
25 void log(const TitanLoggerApi::TitanLogEvent& event, bool log_buffered,
26 bool separate_file, bool use_emergency_mask);
27 void set_parameter(const char *parameter_name, const char *parameter_value);
28 // do not implement ILoggerPlugin::set_file_name();
29 // it gets a filename skeleton and can't expand it.
31 virtual void open_file(bool /*is_first*/);
32 virtual void close_file();
34 enum xml_escape_char_t { LT=0x01, GT=0x02, QUOT=0x04, APOS=0x08, AMP=0x10 };
35 CHARSTRING escape_xml(const CHARSTRING& xml_str, int escape_chars);
36 CHARSTRING escape_xml_attribute(const CHARSTRING& attr_str) { return escape_xml(attr_str, QUOT|AMP); }
37 CHARSTRING escape_xml_element(const CHARSTRING& elem_str) { return escape_xml(elem_str, LT|AMP); }
38 CHARSTRING escape_xml_comment(const CHARSTRING& comm_str) { return escape_xml(comm_str, AMP); /* FIXME: --> should be escaped too */ }
43 char *testsuite_name_;
49 #endif // JUnitLogger_HH