]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/log/doc/log.qbk
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / log / doc / log.qbk
1 [library Boost.Log
2 [quickbook 1.5]
3 [version v2]
4 [authors [Semashev, Andrey]]
5 [copyright 2007 - 2016 Andrey Semashev]
6 [license
7 Distributed under the Boost Software License, Version 1.0.
8 (See accompanying file LICENSE_1_0.txt or copy at
9 [@http://www.boost.org/LICENSE_1_0.txt]).
10 ]
11 [id log]
12 [source-mode c++]
13 [last-revision $Date$]
14 ]
15
16 [c++]
17
18 [/ Links to external resources /]
19 [def __boost_config__ [@http://www.boost.org/doc/libs/release/libs/config/doc/html/index.html Boost.Config]]
20 [def __boost_atomic__ [@http://www.boost.org/doc/libs/release/doc/html/atomic.html Boost.Atomic]]
21 [def __boost_smart_ptr__ [@http://www.boost.org/doc/libs/release/libs/smart_ptr/smart_ptr.htm Boost.SmartPtr]]
22 [def __boost_function__ [@http://www.boost.org/doc/libs/release/doc/html/function.html Boost.Function]]
23 [def __boost_filesystem__ [@http://www.boost.org/doc/libs/release/libs/filesystem/doc/index.htm Boost.Filesystem]]
24 [def __boost_system__ [@http://www.boost.org/doc/libs/release/libs/system/doc/index.html Boost.System]]
25 [def __boost_date_time__ [@http://www.boost.org/doc/libs/release/doc/html/date_time.html Boost.DateTime]]
26 [def __boost_date_time_format__ [@http://www.boost.org/doc/libs/release/doc/html/date_time/date_time_io.html#date_time.format_flags Boost.DateTime]]
27 [def __boost_thread__ [@http://www.boost.org/doc/libs/release/doc/html/thread.html Boost.Thread]]
28 [def __boost_regex__ [@http://www.boost.org/doc/libs/release/libs/regex/index.html Boost.Regex]]
29 [def __boost_xpressive__ [@http://www.boost.org/doc/libs/release/doc/html/xpressive.html Boost.Xpressive]]
30 [def __boost_parameter__ [@http://www.boost.org/doc/libs/release/libs/parameter/doc/html/index.html Boost.Parameter]]
31 [def __boost_format__ [@http://www.boost.org/doc/libs/release/libs/format/index.html Boost.Format]]
32 [def __boost_preprocessor__ [@http://www.boost.org/doc/libs/release/libs/preprocessor/doc/index.html Boost.Preprocessor]]
33 [def __boost_bind__ [@http://www.boost.org/doc/libs/release/libs/bind/bind.html Boost.Bind]]
34 [def __boost_lambda__ [@http://www.boost.org/doc/libs/release/doc/html/lambda.html Boost.Lambda]]
35 [def __boost_phoenix__ [@http://www.boost.org/doc/libs/release/libs/phoenix/doc/html/index.html Boost.Phoenix]]
36 [def __boost_spirit__ [@http://www.boost.org/doc/libs/release/libs/spirit/classic/index.html Boost.Spirit]]
37 [def __boost_spirit2__ [@http://www.boost.org/doc/libs/release/libs/spirit/doc/html/index.html Boost.Spirit2]]
38 [def __boost_optional__ [@http://www.boost.org/doc/libs/release/libs/optional/index.html Boost.Optional]]
39 [def __boost_variant__ [@http://www.boost.org/doc/libs/release/doc/html/variant.html Boost.Variant]]
40 [def __boost_intrusive__ [@http://www.boost.org/doc/libs/release/doc/html/intrusive.html Boost.Intrusive]]
41 [def __boost_iostreams__ [@http://www.boost.org/doc/libs/release/libs/iostreams/doc/index.html Boost.IOStreams]]
42 [def __boost_mpl__ [@http://www.boost.org/doc/libs/release/libs/mpl/doc/index.html Boost.MPL]]
43 [def __boost_exception__ [@http://www.boost.org/doc/libs/release/libs/exception/doc/boost-exception.html Boost.Exception]]
44 [def __boost_scope_exit__ [@http://www.boost.org/doc/libs/release/libs/scope_exit/doc/html/index.html Boost.ScopeExit]]
45 [def __boost_any__ [@http://www.boost.org/doc/libs/release/doc/html/any.html Boost.Any]]
46 [def __boost_property_tree__ [@http://www.boost.org/doc/libs/release/doc/html/property_tree.html Boost.PropertyTree]]
47 [def __boost_asio__ [@http://www.boost.org/doc/libs/release/doc/html/boost_asio.html Boost.ASIO]]
48 [def __boost_move__ [@http://www.boost.org/doc/libs/release/doc/html/move.html Boost.Move]]
49 [def __boost_locale__ [@http://www.boost.org/doc/libs/release/libs/locale/doc/html/index.html Boost.Locale]]
50 [def __boost_type_index__ [@http://www.boost.org/doc/libs/release/doc/html/boost_typeindex.html Boost.TypeIndex]]
51 [def __boost_utility__ [@http://www.boost.org/doc/libs/release/libs/utility/utility.htm Boost.Utility]]
52 [def __boost_quickbook__ [@http://www.boost.org/doc/libs/release/doc/html/quickbook.html Boost.Quickbook]]
53
54 [template ticket[key] '''<ulink url="https://svn.boost.org/trac/boost/ticket/'''[key]'''">#'''[key]'''</ulink>''']
55
56 [/ Auto-generated macros that refer to Reference sections /]
57 [include top_level_reference.qbk]
58 [include core_reference.qbk]
59 [include attributes_reference.qbk]
60 [include expressions_reference.qbk]
61 [include sources_reference.qbk]
62 [include sinks_reference.qbk]
63 [include utility_reference.qbk]
64 [include support_reference.qbk]
65
66 [/ Code samples /]
67 [import ../example/doc/tutorial_trivial.cpp]
68 [import ../example/doc/tutorial_trivial_flt.cpp]
69 [import ../example/doc/tutorial_file.cpp]
70 [import ../example/doc/tutorial_file_manual.cpp]
71 [import ../example/doc/tutorial_fmt_stream.cpp]
72 [import ../example/doc/tutorial_fmt_stream_manual.cpp]
73 [import ../example/doc/tutorial_fmt_format.cpp]
74 [import ../example/doc/tutorial_fmt_string.cpp]
75 [import ../example/doc/tutorial_fmt_custom.cpp]
76 [import ../example/doc/tutorial_logging.cpp]
77 [import ../example/doc/tutorial_attributes.cpp]
78 [import ../example/doc/tutorial_filtering.cpp]
79 [import ../example/doc/core_record.cpp]
80 [import ../example/doc/core_core_manual.cpp]
81 [import ../example/doc/attr_value_visitation.cpp]
82 [import ../example/doc/attr_value_extraction.cpp]
83 [import ../example/doc/expressions_attr_fmt_tag.cpp]
84 [import ../example/doc/expressions_keyword_fmt_tag.cpp]
85 [import ../example/doc/expressions_has_attr_stat_accum.cpp]
86 [import ../example/doc/expressions_channel_severity_filter.cpp]
87 [import ../example/doc/sources_net_connection.cpp]
88 [import ../example/doc/sources_net_connection_chan.cpp]
89 [import ../example/doc/sources_net_connection_dynamic_chan.cpp]
90 [import ../example/doc/sources_severity.cpp]
91 [import ../example/doc/sources_severity_channel.cpp]
92 [import ../example/doc/exception_handling.cpp]
93 [import ../example/doc/sinks_unlocked.cpp]
94 [import ../example/doc/sinks_sync.cpp]
95 [import ../example/doc/sinks_async.cpp]
96 [import ../example/doc/sinks_async_bounded.cpp]
97 [import ../example/doc/sinks_async_ordering.cpp]
98 [import ../example/doc/sinks_ostream.cpp]
99 [import ../example/doc/sinks_file.cpp]
100 [import ../example/doc/sinks_xml_file.cpp]
101 [import ../example/doc/sinks_multifile.cpp]
102 [import ../example/doc/sinks_syslog.cpp]
103 [import ../example/doc/sinks_debugger.cpp]
104 [import ../example/doc/sinks_simple_event_log.cpp]
105 [import ../example/doc/sinks_ipc_logger.cpp]
106 [import ../example/doc/sinks_ipc_receiver.cpp]
107 [import ../example/doc/util_static_type_disp.cpp]
108 [import ../example/doc/util_dynamic_type_disp.cpp]
109 [import ../example/doc/util_manip_to_log.cpp]
110 [import ../example/doc/util_ipc_reliable_mq_writer.cpp]
111 [import ../example/doc/extension_stat_collector.cpp]
112 [import ../example/doc/extension_app_launcher.cpp]
113 [import ../example/doc/extension_record_tagger.cpp]
114 [import ../example/doc/extension_system_uptime_attr.cpp]
115 [import ../example/doc/extension_formatter_parser.cpp]
116 [import ../example/doc/extension_filter_parser.cpp]
117 [import ../example/doc/extension_filter_parser_custom_rel.cpp]
118 [import ../example/doc/extension_stat_collector_settings.cpp]
119 [import ../example/wide_char/main.cpp]
120 [import ../example/event_log/main.cpp]
121
122 [section:moti Motivation]
123
124 Today applications grow rapidly, becoming complicated and difficult to test and debug. Most of the time applications run on a remote site, leaving the developer little chance to monitor their execution and figure out the reasons for their failure, once it should happen. Moreover, even the local debugging may become problematic if the application behavior depends heavily on asynchronous side events, such as a device feedback or another process activity.
125
126 This is where logging can help. The application stores all essential information about its execution to a log, and when something goes wrong this information can be used to analyze the program behavior and make the necessary corrections. There are other very useful applications of logging, such as gathering statistical information and highlighting events (i.e. indicating that some situation has occurred or that the application is experiencing some problems). These tasks have proved to be vital for many real-world industrial applications.
127
128 This library aims to make logging significantly easier for the application developer. It provides a wide range of out-of-the-box tools along with public interfaces for extending the library. The main goals of the library are:
129
130 * Simplicity. A small example code snippet should be enough to get the feel of the library and be ready to use its basic features.
131 * Extensibility. A user should be able to extend functionality of the library for collecting and storing information into logs.
132 * Performance. The library should have as little performance impact on the user's application as possible.
133
134 [endsect]
135
136 [section:how_to_read How to read the documentation]
137
138 The documentation is oriented to both new and experienced library users. However, users are expected to be familiar with commonly used Boost components, such as `shared_ptr`, `make_shared` (see __boost_smart_ptr__), and `function` (__boost_function__). Some parts of the documentation will refer to other Boost libraries, as needed.
139
140 If this is your first experience with the library, it is recommended to read the [link log.design Design overview] section for a first glance at the library's capabilities and architecture. The [link log.installation Installation] and [link log.tutorial Tutorial] sections will help to get started experimenting with the library. The tutorial gives an overview of the library features with sample code snippets. Some tutorial steps are presented in two forms: simple and advanced. The simple form typically describes the most common and easy way to do the task and it is being recommended to be read by new users. The advanced form usually gives an expanded way to do the same thing but with an in-depth explanation and the ability to do some extra customization. This form may come in handy for more experienced users and should generally be read if the easy way does not satisfy your needs.
141
142 Besides the tutorial there is a [link log.detailed Detailed features description] chapter. This part describes other tools provided by the library that were not covered by the tutorial. This chapter is best read on a case by case basis.
143
144 Last, but not least, there is a reference which gives the formal description of library components.
145
146 To keep the code snippets in this documentation simple, the following namespace aliases are assumed to be defined:
147
148 namespace logging = boost::log;
149 namespace sinks = boost::log::sinks;
150 namespace src = boost::log::sources;
151 namespace expr = boost::log::expressions;
152 namespace attrs = boost::log::attributes;
153 namespace keywords = boost::log::keywords;
154
155 [endsect]
156
157 [section:installation Installation and compatibility]
158
159 [section:supported_compilers Supported compilers and platforms]
160
161 The library should build and work with a reasonably compliant compiler. The library was successfully built and tested on the following platforms:
162
163 * Windows XP, Windows Vista, Windows 7. MSVC 8.0 SP1, MSVC 9.0 and newer.
164 * Linux. GCC 4.5 and newer. Older versions may work too, but it was not tested.
165 * Linux. Intel C++ 13.1.0.146 Build 20130121.
166 * Linux. Clang 3.2 and newer.
167
168 The following compilers/platforms are not supported and will likely fail to compile the library:
169
170 * C++11 compilers with non-C++11 standard libraries (like Clang with libstdc++ from GCC 4.2). Please, use a C++11 standard library in C++11 mode.
171 * MSVC 8.0 (without SP1) and older.
172 * GCC 4.2 and older.
173 * Borland C++ 5.5.1 (free version). Newer versions might or might not work.
174 * Solaris Studio 12.3 and older.
175 * Windows 9x, ME, NT4, 2000 and older are not supported.
176
177 Boost.Log should be compatible with all hardware architectures supported by Boost. However, in case of 32 bit x86 architecture the library requires at least i586 class CPU to run.
178
179 [heading Notes for GCC users]
180
181 GCC versions since 4.5 support link time optimization (LTO), when most of optimizations and binary code generation happens at linking stage. This allows to perform more advanced optimizations and produce faster code. Unfortunately, it does not play well with projects containing source files that need to be compiled with different compiler options. Boost.Log is one of such projects, some parts of its sources contain optimizations for modern CPUs and will not run on older CPUs. Enabling LTO for Boost.Log will produce binaries incompatible with older CPUs (GCC bugs [@https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61043 61043], [@https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77845 77845]), which will likely result in crashes in run time. For this reason LTO is not supported in Boost.Log.
182
183 There is a GCC [@http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60607 bug] which may cause compilation failures when `-march=native` command line argument is used. It is recommended to avoid using `-march=native` argument (or `instruction-set=native` bjam property) and instead explicitly specify the target CPU (e.g. `instruction-set=sandy-bridge`).
184
185 [heading Notes for MinGW, Cygwin and Visual Studio Express Edition users]
186
187 In order to compile the library with these compilers special preparations are needed. First, in case of MinGW or Cygwin make sure you have installed the latest GCC version. The library will most likely fail to compile with GCC 3.x.
188
189 Second, at some point the library will require a Message Compiler tool (`mc.exe`), which is not available in MinGW, Cygwin and some versions of MSVC Express Edition. Typically the library build scripts will automatically detect if message compiler is present on the system and disable Event log related portion of the library if it's not. If Event log support is required and it is not found on the system, you have three options to settle the problem. The recommended solution is to obtain the original `mc.exe`. This tool is available in Windows SDK, which can be downloaded from the Microsoft site freely (for example, [@http://www.microsoft.com/downloads/details.aspx?FamilyID=71deb800-c591-4f97-a900-bea146e4fae1&displaylang=en here]). Also, this tool should be available in Visual Studio 2010 Express Edition. During the compilation, `mc.exe` should be accessible through one of the directories in your `PATH` environment variable.
190
191 Another way is to attempt to use the `windmc.exe` tool distributed with MinGW and Cygwin, which is the analogue of the original `mc.exe`. In order to do that you will have to patch Boost.Build files (in particular, the `tools/build/tools/mc.jam` file) as described in [@https://svn.boost.org/trac/boost/ticket/4111 this] ticket. After that you will be able to specify the `mc-compiler=windmc` option to bjam to build the library.
192
193 In case if message compiler detection fails for some reason, you can explicitly disable support for event log backend by defining the `BOOST_LOG_WITHOUT_EVENT_LOG` configuration macro when building the library. This will remove the need for the message compiler. See [link log.installation.config this section] for more configuration options.
194
195 MinGW users on Windows XP may be affected by the [@http://sourceforge.net/p/mingw-w64/bugs/307/ bug] in msvcrt.dll that is bundled with the operating system. The bug manifests itself as crashes while the library formats log records. This problem is not specific to Boost.Log and may also show in different contexts related to locale and IO-streams management.
196
197 [heading Additional notes for Cygwin users]
198
199 Cygwin support is very preliminary. The default GCC version available in Cygwin (4.5.3 as of this writing) is unable to compile the library because of compiler errors. You will have to build a newer GCC from sources. Even then some Boost.Log functionality is not available. In particular, the socket-based syslog backend is not supported, as it is based on __boost_asio__, which doesn't compile on this platform. However, the native syslog support is still in place.
200
201 [endsect]
202
203 [section:config Configuring and building the library]
204
205 The library has a separately compiled part which should be built as described in the [@http://www.boost.org/doc/libs/release/more/getting_started/ Getting Started guide]. One thing should be noted, though. If your application consists of more than one module (e.g. an exe and one or several dll's) that use Boost.Log, the library _must_ be built as a shared object. If you have a single executable or a single module that works with Boost.Log, you may build the library as a static library.
206
207 The library supports a number of configuration macros:
208
209 [table Configuration macros
210 [[Macro name] [Effect]]
211 [[`BOOST_LOG_DYN_LINK`] [If defined in user code, the library will assume the binary is built as a dynamically loaded library ("dll" or "so"). Otherwise it is assumed that the library is built in static mode. This macro must be either defined or not defined for all translation units of user application that uses logging. This macro can help with auto-linking on platforms that support it.]]
212 [[`BOOST_ALL_DYN_LINK`] [Same as `BOOST_LOG_DYN_LINK` but also affects other Boost libraries the same way.]]
213 [[`BOOST_USE_WINAPI_VERSION`] [Affects compilation of both the library and user's code. This macro is Windows-specific. Selects the target Windows version for various Boost libraries, including Boost.Log. Code compiled for a particular Windows version will likely fail to run on the older Windows versions, but may improve performance because of using newer OS features. The macro is expected to have an integer value equivalent to [@https://msdn.microsoft.com/en-us/library/6sehtctf.aspx `_WIN32_WINNT`].]]
214 [[`BOOST_LOG_NO_THREADS`] [If defined, disables multithreading support. Affects the compilation of both the library and users' code. The macro is automatically defined if no threading support is detected.]]
215 [[`BOOST_LOG_WITHOUT_CHAR`] [If defined, disables support for narrow character logging. Affects the compilation of both the library and users' code.]]
216 [[`BOOST_LOG_WITHOUT_WCHAR_T`] [If defined, disables support for wide character logging. Affects the compilation of both the library and users' code.]]
217 [[`BOOST_LOG_NO_QUERY_PERFORMANCE_COUNTER`] [This macro is only useful on Windows. It affects the compilation of both the library and users' code. If defined, disables support for the `QueryPerformanceCounter` API in the `timer` attribute. This will result in significantly less accurate time readings. The macro is intended to solve possible problems with earlier revisions of AMD Athlon CPU, described [@http://support.microsoft.com/?scid=kb;en-us;895980 here] and [@http://support.microsoft.com/?id=896256 here]. There are also known chipset hardware failures that may prevent this API from functioning properly (see [@http://support.microsoft.com/kb/274323 here]).]]
218 [[`BOOST_LOG_USE_NATIVE_SYSLOG`] [Affects only compilation of the library. If for some reason support for the native SysLog API is not detected automatically, define this macro to forcibly enable it]]
219 [[`BOOST_LOG_WITHOUT_DEFAULT_FACTORIES`] [Affects only compilation of the library. If defined, the parsers for settings will be built without any default factories for filters and formatters. The user will have to register all attributes in the library before parsing any filters or formatters from strings. This can substantially reduce the binary size.]]
220 [[`BOOST_LOG_WITHOUT_SETTINGS_PARSERS`] [Affects only compilation of the library. If defined, none of the facilities related to the parsers for settings will be built. This can substantially reduce the binary size.]]
221 [[`BOOST_LOG_WITHOUT_DEBUG_OUTPUT`] [Affects only compilation of the library. If defined, the support for debugger output on Windows will not be built.]]
222 [[`BOOST_LOG_WITHOUT_EVENT_LOG`] [Affects only compilation of the library. If defined, the support for Windows event log will not be built. Defining the macro also makes Message Compiler toolset unnecessary.]]
223 [[`BOOST_LOG_WITHOUT_SYSLOG`] [Affects only compilation of the library. If defined, the support for syslog backend will not be built.]]
224 [[`BOOST_LOG_WITHOUT_IPC`] [Affects only compilation of the library. If defined, the support for interprocess queues will not be built.]]
225 [[`BOOST_LOG_NO_SHORTHAND_NAMES`] [Affects only compilation of users' code. If defined, some deprecated shorthand macro names will not be available.]]
226 [[`BOOST_LOG_USE_COMPILER_TLS`] [Affects only compilation of the library. This macro enables support for compiler intrinsics for thread-local storage. Defining it may improve performance of Boost.Log if certain usage limitations are acceptable. See below for more comments.]]
227 [[`BOOST_LOG_USE_STD_REGEX`, `BOOST_LOG_USE_BOOST_REGEX` or `BOOST_LOG_USE_BOOST_XPRESSIVE`] [Affects only compilation of the library. By defining one of these macros the user can instruct Boost.Log to use `std::regex`, __boost_regex__ or __boost_xpressive__ internally for string matching filters parsed from strings and settings. If none of these macros is defined then Boost.Log uses __boost_regex__ by default. Using `std::regex` or __boost_regex__ typically produces smaller executables, __boost_regex__ usually also being the fastest in run time. Using __boost_xpressive__ allows to eliminate the dependency on __boost_regex__ compiled binary. Note that these macros do not affect [link log.detailed.expressions.predicates.advanced_string_matching filtering expressions] created by users.]]
228 ]
229
230 You can define configuration macros in the `bjam` command line, like this:
231
232 [pre
233 bjam --with-log variant=release define=BOOST_LOG_WITHOUT_EVENT_LOG define=BOOST_USE_WINAPI_VERSION=0x0600 stage
234 ]
235
236 However, it may be more convenient to define configuration macros in the "boost/config/user.hpp" file in order to automatically define them both for the library and user's projects. If none of the options are specified, the library will try to support the most comprehensive setup, including support for all character types and features available for the target platform.
237
238 The logging library uses several other Boost libraries that require building too. These are __boost_filesystem__, __boost_system__, __boost_date_time__, __boost_thread__ and in some configurations __boost_regex__. Refer to their documentation for detailed instructions on the building procedure.
239
240 One final thing should be added. The library requires run-time type information (RTTI) to be enabled for both the library compilation and user's code compilation. Normally, this won't need anything from you except to verify that RTTI support is not disabled in your project.
241
242 [heading Notes about compiler-supplied intrinsics for TLS]
243
244 Many widely used compilers support builtin intrinsics for managing thread-local storage, which is used in several parts of the library. This feature is also included in the C++11 standard. Generally, these intrinsics allow for a much more efficient access to the storage than any surrogate implementation, be that __boost_thread__ or even native operating system API. However, this feature has several caveats:
245
246 * Some operating systems don't support the use of these intrinsics in case if the TLS is defined in a shared library that is dynamically loaded during the application run time. These systems include Linux and Windows prior to Vista. Windows Vista and later do not have this issue.
247 * The TLS may not be reliably accessed from global constructors and destructors. At least MSVC 8.0 on Windows is known to have this problem.
248
249 The library provides the `BOOST_LOG_USE_COMPILER_TLS` configuration macro that allows to enable the use of this feature, which will improve the library performance at the cost of these limitations:
250
251 * The application executable must be linked with the Boost.Log library. It should not be loaded dynamically during run time.
252 * The application must not use logging in global constructors or destructors.
253
254 Note that the `BOOST_LOG_USE_COMPILER_TLS` macro only controls use of TLS in Boost.Log but not in other libraries used by Boost.Log. For example, __boost_asio__ uses compiler-supplied TLS by default. In order to build Boost.Log binaries completely free from use of compiler-supplied TLS, this feature has to be disabled in those other libraries as well (in case of __boost_asio__ this can be achieved by defining `BOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION` when building and using Boost).
255
256 [heading Notes about native `wchar_t` support]
257
258 Some compilers, most notably MSVC, have an option to disable the native `wchar_t` type, emulating it with a typedef for one of the standard integral types. From the C++ language perspective this behavior is not conforming but it may be useful for compatibility with some legacy code which is difficult to update.
259
260 By default, Boost (and Boost.Log being part of it) is built with native `wchar_t` enabled. At the time of this writing, user will have to modify Boost.Build to enable the emulation mode. It is possible to build Boost.Log in this mode, but there are several caveats that have to be kept in mind:
261
262 * The compiled Boost.Log binaries will be exporting symbols corresponding to the configuration chosen at build time. The user's code will have to use the same setting as was used when building Boost.Log, otherwise linking errors will appear.
263 * Since in emulation mode `wchar_t` is undistinguishable from one of the integer types, certain parts of the library may behave differently from the normal mode with native `wchar_t`. In particular, wide-character literals may be rejected or formatted differently.
264 * The emulation mode is not tested, so unexpected breakages are possible.
265
266 Because of that using the emulation mode is discouraged and should be avoided. In future releases of the library its support may be removed completely.
267
268 [endsect]
269
270 [endsect]
271
272 [section:defs Definitions]
273
274 Here are definitions of some terms that will be used widely throughout the documentation:
275
276 [variablelist
277 [[Log record][A single bundle of information, collected from the user's application, that is a candidate to be put into the log. In a simple case the log record will be represented as a line of text in the log file after being processed by the logging library.]]
278 [[Attribute][An "attribute" is a piece of meta-information that can be used to specialize a log record. In Boost.Log attributes are represented by function objects with a specific interface, which return the actual attribute value when invoked.]]
279 [[Attribute value][Attribute values are the actual data acquired from attributes. This data is attached to the specific log record and processed by the library. Values can have different types (integers, strings and more complex, including user defined types). Some examples of attribute values: current time stamp value, file name, line number, current scope name, etc.. Attribute values are enveloped in a type erasing wrapper, so the actual type of the attribute is not visible in the interface. The actual (erased) type of the value is sometimes called the stored type.]]
280 [[(Attribute) value visitation][A way of processing the attribute value. This approach involves a function object (a visitor) which is applied to the attribute value. The visitor should know the stored type of the attribute value in order to process it.]]
281 [[(Attribute) value extraction][A way of processing the attribute value when the caller attempts to obtain a reference to the stored value. The caller should know the stored type of the attribute value in order to be able to extract it.]]
282 [[Log sink][A target, to which all log records are fed after being collected from the user's application. The sink defines where and how the log records are going to be stored or processed.]]
283 [[Log source][An entry point for the user's application to put log records to. In a simple case it is an object (logger) which maintains a set of attributes that will be used to form a log record upon the user's request. However, one can surely create a source that would emit log records on some side events (for example, by intercepting and parsing console output of another application).]]
284 [[Log filter][A predicate that takes a log record and tells whether this record should be passed through or discarded. The predicate typically forms its decision based on the attribute values attached to the record.]]
285 [[Log formatter][A function object that generates the final textual output from a log record. Some sinks, e.g. a binary logging sink, may not need it, although almost any text-based sink would use a formatter to compose its output.]]
286 [[Logging core][The global entity that maintains connections between sources and sinks and applies filters to records. It is mainly used when the logging library is initialized.]]
287 [[i18n][Internationalization. The ability to manipulate wide characters.]]
288 [[TLS][Thread-local storage. The concept of having a variable that has independent values for each thread that attempts to access it.]]
289 [[RTTI][Run-time type information. This is the C++ language support data structures required for `dynamic_cast` and `typeid` operators to function properly.]]
290 ]
291
292 [endsect]
293
294 [include:log design.qbk]
295
296 [include:log tutorial.qbk]
297
298 [section:detailed Detailed features description]
299
300 [include:log core.qbk]
301 [include:log sources.qbk]
302 [include:log sink_frontends.qbk]
303 [include:log sink_backends.qbk]
304 [include:log expressions.qbk]
305 [include:log attributes.qbk]
306 [include:log utilities.qbk]
307
308 [endsect]
309
310 [include:log extension.qbk]
311 [include:log rationale.qbk]
312
313 [section:reference Reference]
314
315 [xinclude top_level_reference.xml]
316 [xinclude core_reference.xml]
317 [xinclude attributes_reference.xml]
318 [xinclude expressions_reference.xml]
319 [xinclude sources_reference.xml]
320 [xinclude sinks_reference.xml]
321 [xinclude utility_reference.xml]
322 [xinclude support_reference.xml]
323
324 [endsect]
325
326 [include:log changelog.qbk]
327 [include:log todo.qbk]
328
329 [section:acknowledgments Acknowledgments]
330
331 * Vladimir Prus managed the library review in Boost and actually reviewed it in the process.
332 * Adam Wulkiewicz created the logo used on the [@https://github.com/boostorg/log GitHub project page]. The logo was taken from his [@https://github.com/awulkiew/boost-logos collection] of Boost logos.
333 * Luca Rigini wrote the initial implementation of the NT event log sink and made a lot of suggestions on how to improve the library with regard to writing user-defined sinks.
334 * Jean-Daniel Michaud, Michael Lacher and all others who took part in the discussion of the requirements to the library on [@http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Boost.Logging Wiki].
335 * John Torjo, Gennadiy Rozental and others for their discussion on John's logging library on the Boost developers list. It helped a lot to learn the requirements and possible solutions for the library.
336 * All authors of the great Boost libraries that were involved in this library (notably, __boost_smart_ptr__, __boost_thread__, __boost_date_time__, __boost_filesystem__, __boost_intrusive__, __boost_spirit2__ and others) and __boost_quickbook__ authors for a simple yet powerful documenting tool.
337 * All the reviewers and the users who made suggestions and offered their feedback on the library. Most notably, Steven Watanabe for his in-depth studying the docs and the code, with a lot of fruitful comments on both.
338
339 [endsect]