summaryrefslogtreecommitdiff
path: root/libs/log/doc/html/log/detailed/utilities.html
diff options
context:
space:
mode:
Diffstat (limited to 'libs/log/doc/html/log/detailed/utilities.html')
-rw-r--r--libs/log/doc/html/log/detailed/utilities.html72
1 files changed, 41 insertions, 31 deletions
diff --git a/libs/log/doc/html/log/detailed/utilities.html b/libs/log/doc/html/log/detailed/utilities.html
index 0dec19f3f..3809d733c 100644
--- a/libs/log/doc/html/log/detailed/utilities.html
+++ b/libs/log/doc/html/log/detailed/utilities.html
@@ -51,14 +51,14 @@
safety when using string literals instead of regular strings.
</p>
<p>
- The functionality is implemented in the <code class="computeroutput"><a class="link" href="../../boost/log/basic_string_literal.html" title="Class template basic_string_literal">basic_string_literal</a></code>
+ The functionality is implemented in the [class_log_basic_string_literal]
class template, which is parametrized with the character and character
traits, similar to <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span></code>.
There are also two convenience typedefs provided: <code class="computeroutput"><span class="identifier">string_literal</span></code>
and <code class="computeroutput"><span class="identifier">wstring_literal</span></code>, for
narrow and wide character types, respectively. In order to ease string
literal construction in generic code there is also a <code class="computeroutput"><span class="identifier">str_literal</span></code>
- function template that accepts a string literal and returns a <code class="computeroutput"><a class="link" href="../../boost/log/basic_string_literal.html" title="Class template basic_string_literal">basic_string_literal</a></code>
+ function template that accepts a string literal and returns a [class_log_basic_string_literal]
instance for the appropriate character type.
</p>
<p>
@@ -982,7 +982,7 @@
equivalent is used.
</p>
<p>
- You can also use the <code class="computeroutput"><a class="link" href="../../boost/log/make_attr_orde_idp39994624.html" title="Function template make_attr_ordering">make_attr_ordering</a></code> generator
+ You can also use the <code class="computeroutput"><a class="link" href="../../boost/log/make_attr_orde_idp46476928.html" title="Function template make_attr_ordering">make_attr_ordering</a></code> generator
function to automatically generate the <code class="computeroutput"><a class="link" href="../../boost/log/attribute_value_ordering.html" title="Class template attribute_value_ordering">attribute_value_ordering</a></code>
instance based on the attribute value name and the ordering function. This
might be useful if the ordering function has a non-trivial type, like the
@@ -1010,7 +1010,7 @@
by the library, therefore in order to reacquire the exception object it
has to rethrow it. The header defines an <code class="computeroutput"><a class="link" href="../../boost/log/exception_handler.html" title="Class template exception_handler">exception_handler</a></code>
template functor that does just that and then forwards the exception object
- to a unary user-defined functional object. The <code class="computeroutput"><a class="link" href="../../boost/log/make_exception_idp34566448.html" title="Function template make_exception_handler">make_exception_handler</a></code>
+ to a unary user-defined functional object. The <code class="computeroutput"><a class="link" href="../../boost/log/make_exception_idp40577664.html" title="Function template make_exception_handler">make_exception_handler</a></code>
function can be used to simplify the handler construction. All expected
exception types should be specified explicitly in the call, in the order
they would appear in the <code class="computeroutput"><span class="keyword">catch</span></code>
@@ -1130,7 +1130,7 @@
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><code class="computeroutput"><a class="link" href="../../utilities.html#header.boost.log.utility.manipulators.to_log_hpp" title="Header &lt;boost/log/utility/manipulators/to_log.hpp&gt;">boost/log/utility/manipulators/to_log.hpp</a></code><span class="special">&gt;</span>
</pre>
<p>
- The <code class="computeroutput"><a class="link" href="../../boost/log/to_log_idp39929968.html" title="Function template to_log">to_log</a></code>
+ The <code class="computeroutput"><a class="link" href="../../boost/log/to_log_idp46412272.html" title="Function template to_log">to_log</a></code>
function creates a stream manipulator that simply outputs the adopted
value to the stream. By default its behavior is equivalent to simply
putting the value to the stream. However, the user is able to overload
@@ -1171,7 +1171,7 @@
value contexts as well. The library uses this feature to allow different
formatting ruled for different attribute values, even if the stored value
type is the same. To do so one has to specify an explicit template argument
- for <code class="computeroutput"><a class="link" href="../../boost/log/to_log_idp39929968.html" title="Function template to_log">to_log</a></code>,
+ for <code class="computeroutput"><a class="link" href="../../boost/log/to_log_idp46412272.html" title="Function template to_log">to_log</a></code>,
a tag type, which will be embedded into the manipulator type and thus
will allow to define different insertion operators:
</p>
@@ -1259,7 +1259,7 @@
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><code class="computeroutput"><a class="link" href="../../utilities.html#header.boost.log.utility.manipulators.dump_hpp" title="Header &lt;boost/log/utility/manipulators/dump.hpp&gt;">boost/log/utility/manipulators/dump.hpp</a></code><span class="special">&gt;</span>
</pre>
<p>
- The <code class="computeroutput"><a class="link" href="../../boost/log/dump_idp39882112.html" title="Function template dump">dump</a></code>
+ The <code class="computeroutput"><a class="link" href="../../boost/log/dump_idp46364400.html" title="Function template dump">dump</a></code>
function creates a manipulator that outputs binary contents of a contiguous
memory region. This can be useful for logging some low level binary data,
such as encoded network packets or entries of a binary file. The use
@@ -1283,12 +1283,12 @@
<span class="special">}</span>
</pre>
<p>
- There is another manipulator called <code class="computeroutput"><a class="link" href="../../boost/log/dump_elements_idp39887424.html" title="Function template dump_elements">dump_elements</a></code> for printing
+ There is another manipulator called <code class="computeroutput"><a class="link" href="../../boost/log/dump_elements_idp46369712.html" title="Function template dump_elements">dump_elements</a></code> for printing
binary representation of non-byte array elements. The special manipulator
for this case is necessary because the units of the size argument of
- <code class="computeroutput"><a class="link" href="../../boost/log/dump_idp39882112.html" title="Function template dump">dump</a></code>
- can be confusing (is it in bytes or in elements?). Therefore <code class="computeroutput"><a class="link" href="../../boost/log/dump_idp39882112.html" title="Function template dump">dump</a></code>
- will not compile when used for non-byte input data. <code class="computeroutput"><a class="link" href="../../boost/log/dump_elements_idp39887424.html" title="Function template dump_elements">dump_elements</a></code> accepts
+ <code class="computeroutput"><a class="link" href="../../boost/log/dump_idp46364400.html" title="Function template dump">dump</a></code>
+ can be confusing (is it in bytes or in elements?). Therefore <code class="computeroutput"><a class="link" href="../../boost/log/dump_idp46364400.html" title="Function template dump">dump</a></code>
+ will not compile when used for non-byte input data. <code class="computeroutput"><a class="link" href="../../boost/log/dump_elements_idp46369712.html" title="Function template dump_elements">dump_elements</a></code> accepts
the same arguments, and its size-related arguments always designate the
number of elements to process.
</p>
@@ -1374,7 +1374,7 @@
<p>
Pretty easy, isn't it? There is also the <code class="computeroutput"><span class="identifier">wadd_console_log</span></code>
function for wide-character console. If you want to put logs to some
- other standard stream, you can pass the stream to the <code class="computeroutput"><a class="link" href="../../boost/log/add_console_lo_idp40017824.html" title="Function template add_console_log">add_console_log</a></code> function
+ other standard stream, you can pass the stream to the <code class="computeroutput"><a class="link" href="../../boost/log/add_console_lo_idp46500160.html" title="Function template add_console_log">add_console_log</a></code> function
as an argument. E.g. enabling logging to <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span></code>
instead of <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">clog</span></code> would look like this:
</p>
@@ -1420,7 +1420,7 @@
<span class="special">}</span>
</pre>
<p>
- The <code class="computeroutput"><a class="link" href="../../boost/log/add_console_lo_idp40017824.html" title="Function template add_console_log">add_console_log</a></code>
+ The <code class="computeroutput"><a class="link" href="../../boost/log/add_console_lo_idp46500160.html" title="Function template add_console_log">add_console_log</a></code>
and <code class="computeroutput"><a class="link" href="../../boost/log/add_file_log.html" title="Function template add_file_log">add_file_log</a></code>
functions do not conflict and may be combined freely, so it is possible
to set up logging to the console and a couple of files, including filtering
@@ -1623,13 +1623,20 @@ relation:
<br class="table-break"><p>
The formatter string syntax is even simpler and pretty much resembles
<a href="http://www.boost.org/doc/libs/release/libs/format/index.html" target="_top">Boost.Format</a>
- format string syntax. The string must contain attribute names enclosed
- in percent signs ("%"), the corresponding attribute value will
- replace these placeholders. The placeholder "%Message%" will
- be replaced with the log record text. For instance, <code class="computeroutput"><span class="special">[%</span><span class="identifier">TimeStamp</span><span class="special">%]</span>
- <span class="special">*%</span><span class="identifier">Severity</span><span class="special">%*</span> <span class="special">%</span><span class="identifier">Message</span><span class="special">%</span></code> formatter string will make log records
- look like this: <code class="computeroutput"><span class="special">[</span><span class="number">2008</span><span class="special">-</span><span class="number">07</span><span class="special">-</span><span class="number">05</span> <span class="number">13</span><span class="special">:</span><span class="number">44</span><span class="special">:</span><span class="number">23</span><span class="special">]</span> <span class="special">*</span><span class="number">0</span><span class="special">*</span> <span class="identifier">Hello</span> <span class="identifier">world</span></code>.
+ format string syntax. The string is interpreted as a template which can
+ contain attribute names enclosed with percent signs ("%").
+ The corresponding attribute values will replace these placeholders when
+ the formatter is applied. The placeholder "%Message%" will
+ be replaced with the log record text. For instance, the following formatter
+ string:
</p>
+<pre class="programlisting">[%TimeStamp%] *%Severity%* %Message%
+</pre>
+<p>
+ will make log records look like this:
+ </p>
+<pre class="programlisting">[2008-07-05 13:44:23] *0* Hello world
+</pre>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../doc/src/images/note.png"></td>
@@ -1643,11 +1650,13 @@ relation:
</p></td></tr>
</table></div>
<p>
- It must be noted, though, that by default the library only supports those
- attribute value types <a class="link" href="utilities.html#log.detailed.utilities.predef_types" title="Predefined type sequences">which
+ It must be noted that by default the library only supports those attribute
+ value types <a class="link" href="utilities.html#log.detailed.utilities.predef_types" title="Predefined type sequences">which
are known</a> at the library build time. User-defined types will not
work properly in parsed filters and formatters until registered in the
- library. More on this is available in the <a class="link" href="../extension/settings.html" title="Extending library settings support">Extending
+ library. It is also possible to override formatting rules of the known
+ types, including support for additional formatting parameters in the
+ string template. More on this is available in the <a class="link" href="../extension/settings.html" title="Extending library settings support">Extending
the library</a> section.
</p>
<div class="note"><table border="0" summary="Note">
@@ -1657,12 +1666,13 @@ relation:
</tr>
<tr><td align="left" valign="top"><p>
The parsed formatters and filters are generally less optimal than the
- equivalent ones written in code. This is because of two reasons: (*)
- the programmer usually knows more about types of the attribute values
- that may be involved in formatting or filtering and (*) the compiler
- has a better chance to optimize the formatter or filter if it is known
- in compile time. Therefore, if the performance matters, it is advised
- to avoid parsed filters and formatters.
+ equivalent ones written in code with <a class="link" href="expressions.html" title="Lambda expressions">template
+ expressions</a>. This is because of two reasons: (*) the programmer
+ usually knows more about types of the attribute values that may be
+ involved in formatting or filtering and (*) the compiler has a better
+ chance to optimize the formatter or filter if it is known in compile
+ time. Therefore, when performance matters, it is advised to avoid parsed
+ filters and formatters.
</p></td></tr>
</table></div>
</div>
@@ -1784,8 +1794,7 @@ relation:
<br class="table-break"><p>
Sink settings are divided into separate subsections within the common
top-level section "Sinks" - one subsection for each sink. The
- subsection names should denote a user-defined sink name. For example,
- "MyFile".
+ subsection names denote a user-defined sink name. For example, "MyFile".
</p>
<div class="note"><table border="0" summary="Note">
<tr>
@@ -2502,7 +2511,8 @@ AutoFlush=true
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
-<td align="right"><div class="copyright-footer">Copyright &#169; 2007-2014 Andrey Semashev<p>
+<td align="right"><div class="copyright-footer">Copyright &#169; 2007-2015 Andrey
+ Semashev<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
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>).
</p>