2 * Copyright Andrey Semashev 2007 - 2015.
3 * Distributed under the Boost Software License, Version 1.0.
4 * (See accompanying file LICENSE_1_0.txt or copy at
5 * http://www.boost.org/LICENSE_1_0.txt)
8 * \file support/exception.hpp
9 * \author Andrey Semashev
12 * This header enables Boost.Exception support for Boost.Log.
15 #ifndef BOOST_LOG_SUPPORT_EXCEPTION_HPP_INCLUDED_
16 #define BOOST_LOG_SUPPORT_EXCEPTION_HPP_INCLUDED_
19 #include <boost/type_index.hpp>
20 #include <boost/exception/info.hpp>
21 #include <boost/log/detail/config.hpp>
22 #include <boost/log/attributes/attribute_name.hpp>
23 #include <boost/log/attributes/named_scope.hpp>
24 #include <boost/log/detail/header.hpp>
26 #ifdef BOOST_HAS_PRAGMA_ONCE
32 BOOST_LOG_OPEN_NAMESPACE
35 * Attribute name exception information
37 typedef error_info< struct attribute_name_info_tag, attribute_name > attribute_name_info;
40 * Type info exception information
42 typedef error_info< struct type_info_info_tag, typeindex::type_index > type_info_info;
45 * Parse position exception information
47 typedef error_info< struct position_info_tag, unsigned int > position_info;
50 * Current scope exception information
52 typedef error_info< struct current_scope_info_tag, attributes::named_scope_list > current_scope_info;
55 * The function returns an error information object that contains current stack of scopes.
56 * This information can then be attached to an exception and extracted at the catch site.
57 * The extracted scope list won't be affected by any scope changes that may happen during
58 * the exception propagation.
60 * \note See the \c named_scope attribute documentation on how to maintain scope list.
62 inline current_scope_info current_scope()
64 return current_scope_info(attributes::named_scope::get_scopes());
72 * System resource name
74 typedef error_info< struct object_name_tag, object_name > object_name_info;
78 BOOST_LOG_CLOSE_NAMESPACE // namespace log
82 #include <boost/log/detail/footer.hpp>
84 #endif // BOOST_LOG_SUPPORT_EXCEPTION_HPP_INCLUDED_