• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>logger</title>
5<link rel="stylesheet" href="../../../boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="../../../index.html" title="Boost.Test">
8<link rel="up" href="../rt_param_reference.html" title="Runtime parameters reference">
9<link rel="prev" href="log_sink.html" title="log_sink">
10<link rel="next" href="output_format.html" title="output_format">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%"><tr>
14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
15<td align="center"><a href="../../../../../../../index.html">Home</a></td>
16<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
20</tr></table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="log_sink.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../rt_param_reference.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="output_format.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h4 class="title">
27<a name="boost_test.utf_reference.rt_param_reference.logger"></a><a class="link" href="logger.html" title="logger"><code class="computeroutput"><span class="identifier">logger</span></code></a>
28</h4></div></div></div>
29<p>
30          The <span class="emphasis"><em>logger</em></span> parameter allows to fully specify (log
31          format, level and sink) one or several loggers in one command. If this
32          parameter is specified, it has precedence over <a class="link" href="log_format.html" title="log_format"><code class="computeroutput"><span class="identifier">log_format</span></code></a>, <a class="link" href="log_level.html" title="log_level"><code class="computeroutput"><span class="identifier">log_level</span></code></a> and <a class="link" href="log_sink.html" title="log_sink"><code class="computeroutput"><span class="identifier">log_sink</span></code></a>.
33        </p>
34<p>
35          The parameter is <span class="emphasis"><em>repeatable</em></span>: it may appear several
36          times on the command line. It is possible to indicate a set of loggers
37          using the separator ':', which is the only way for repeating a logger description
38          through the environment variable.
39        </p>
40<p>
41          The parameter is composed of three fields separated by a coma ',' and indicating
42          respectively the log format, level and sink. The log format is mandatory.
43          The log level and sink are both optional: if omitted, the default for the
44          specified format will be used. The log level and sink accept the same value
45          as their respective command line switch (see <a class="link" href="log_level.html" title="log_level"><code class="computeroutput"><span class="identifier">log_level</span></code></a> and <a class="link" href="log_sink.html" title="log_sink"><code class="computeroutput"><span class="identifier">log_sink</span></code></a> for more information).
46        </p>
47<h5>
48<a name="boost_test.utf_reference.rt_param_reference.logger.h0"></a>
49          <span class="phrase"><a name="boost_test.utf_reference.rt_param_reference.logger.acceptable_values"></a></span><a class="link" href="logger.html#boost_test.utf_reference.rt_param_reference.logger.acceptable_values">Acceptable
50          values</a>
51        </h5>
52<p>
53          Case sensitive <a class="link" href="../rt_param_reference.html#regular_param_value">string</a>:
54        </p>
55<pre class="programlisting"><span class="identifier">logger_set</span>    <span class="special">::=</span> <span class="special">(</span><span class="identifier">logger</span> <span class="char">':'</span><span class="special">)*</span> <span class="identifier">logger</span>
56<span class="identifier">logger</span>        <span class="special">::=</span> <span class="identifier">logger_format</span> <span class="special">(</span><span class="char">','</span> <span class="identifier">log_level</span><span class="special">?</span> <span class="special">(</span><span class="char">','</span> <span class="identifier">log_sink</span><span class="special">?</span> <span class="special">)?</span> <span class="special">)?</span>
57<span class="identifier">logger_format</span> <span class="special">::=</span> <span class="char">'HRF'</span> <span class="special">|</span> <span class="char">'XML'</span> <span class="special">|</span> <span class="char">'JUNIT'</span>
58<span class="identifier">log_level</span>     <span class="special">::=</span> <span class="char">'all'</span> <span class="special">|</span> <span class="char">'success'</span> <span class="special">|</span> <span class="char">'test_suite'</span> <span class="special">|</span> <span class="char">'message'</span> <span class="special">|</span> <span class="char">'warning'</span> <span class="special">|</span> <span class="char">'error'</span> <span class="special">|</span> <span class="char">'cpp_exception'</span> <span class="special">|</span> <span class="char">'system_error'</span> <span class="special">|</span> <span class="char">'fatal_error'</span> <span class="special">|</span> <span class="char">'nothing'</span>
59<span class="identifier">log_sink</span>      <span class="special">::=</span> <span class="char">'stdout'</span> <span class="special">|</span> <span class="char">'stderr'</span> <span class="special">|</span> <span class="identifier">filename</span>
60</pre>
61<p>
62          Examples:
63        </p>
64<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
65<li class="listitem">
66              <code class="computeroutput"><span class="special">--</span><span class="identifier">logger</span><span class="special">=</span><span class="identifier">HRF</span><span class="special">,</span><span class="identifier">all</span></code>
67              will set the <code class="computeroutput"><span class="identifier">all</span></code> log
68              level for the <code class="computeroutput"><span class="identifier">HRF</span></code> log
69              format, and will use the default sink associated to <code class="computeroutput"><span class="identifier">HRF</span></code>
70              (<code class="computeroutput"><span class="identifier">stdout</span></code>)
71            </li>
72<li class="listitem">
73              <code class="computeroutput"><span class="special">--</span><span class="identifier">logger</span><span class="special">=</span><span class="identifier">JUNIT</span><span class="special">,,</span><span class="identifier">somefile</span><span class="special">.</span><span class="identifier">xml</span><span class="special">:</span><span class="identifier">HRF</span><span class="special">,</span><span class="identifier">warning</span></code>
74              will use the default log level associated to the <code class="computeroutput"><span class="identifier">JUNIT</span></code>
75              log format, and will use the file <code class="computeroutput"><span class="identifier">somefile</span><span class="special">.</span><span class="identifier">xml</span></code>
76              as the log sink. It will also enable the <code class="computeroutput"><span class="identifier">HRF</span></code>
77              format with log level <code class="computeroutput"><span class="identifier">warning</span></code>.
78              The corresponding sink will be set to the <code class="computeroutput"><span class="identifier">HRF</span></code>
79              default (<code class="computeroutput"><span class="identifier">stdout</span></code>).
80            </li>
81</ul></div>
82<h5>
83<a name="boost_test.utf_reference.rt_param_reference.logger.h1"></a>
84          <span class="phrase"><a name="boost_test.utf_reference.rt_param_reference.logger.command_line_syntax"></a></span><a class="link" href="logger.html#boost_test.utf_reference.rt_param_reference.logger.command_line_syntax">Command
85          line syntax</a>
86        </h5>
87<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
88              <code class="computeroutput"><span class="special">--</span><span class="identifier">logger</span><span class="special">=&lt;</span><span class="identifier">logger_set</span><span class="special">&gt;</span></code>
89            </li></ul></div>
90<h5>
91<a name="boost_test.utf_reference.rt_param_reference.logger.h2"></a>
92          <span class="phrase"><a name="boost_test.utf_reference.rt_param_reference.logger.environment_variable"></a></span><a class="link" href="logger.html#boost_test.utf_reference.rt_param_reference.logger.environment_variable">Environment
93          variable</a>
94        </h5>
95<pre class="programlisting"><span class="identifier">BOOST_TEST_LOGGER</span>
96</pre>
97</div>
98<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
99<td align="left"></td>
100<td align="right"><div class="copyright-footer">Copyright © 2001-2020 Boost.Test contributors<p>
101        Distributed under the Boost Software License, Version 1.0. (See accompanying
102        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
103      </p>
104</div></td>
105</tr></table>
106<hr>
107<div class="spirit-nav">
108<a accesskey="p" href="log_sink.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../rt_param_reference.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="output_format.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
109</div>
110</body>
111</html>
112