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 event_log_constants.hpp
9 * \author Andrey Semashev
12 * The header contains definition of constants related to Windows NT Event Log API.
13 * The constants can be used in other places without the event log backend.
16 #ifndef BOOST_LOG_SINKS_EVENT_LOG_CONSTANTS_HPP_INCLUDED_
17 #define BOOST_LOG_SINKS_EVENT_LOG_CONSTANTS_HPP_INCLUDED_
19 #include <boost/log/detail/config.hpp>
21 #ifdef BOOST_HAS_PRAGMA_ONCE
25 #ifndef BOOST_LOG_WITHOUT_EVENT_LOG
27 #include <boost/log/detail/tagged_integer.hpp>
28 #include <boost/log/detail/header.hpp>
32 BOOST_LOG_OPEN_NAMESPACE
39 //! A tagged integral type that represents event identifier for the Windows API
40 typedef boost::log::aux::tagged_integer< unsigned int, event_id_tag > event_id;
42 * The function constructs event identifier from an integer
44 inline event_id make_event_id(unsigned int id)
46 event_id iden = { id };
50 struct event_category_tag;
51 //! A tagged integral type that represents event category for the Windows API
52 typedef boost::log::aux::tagged_integer< unsigned short, event_category_tag > event_category;
54 * The function constructs event category from an integer
56 inline event_category make_event_category(unsigned short cat)
58 event_category category = { cat };
62 //! Windows event types
65 success = 0, //!< Equivalent to EVENTLOG_SUCCESS
66 info = 4, //!< Equivalent to EVENTLOG_INFORMATION_TYPE
67 warning = 2, //!< Equivalent to EVENTLOG_WARNING_TYPE
68 error = 1 //!< Equivalent to EVENTLOG_ERROR_TYPE
72 * The function constructs log record level from an integer
74 BOOST_LOG_API event_type make_event_type(unsigned short lev);
76 } // namespace event_log
80 BOOST_LOG_CLOSE_NAMESPACE // namespace log
84 #include <boost/log/detail/footer.hpp>
86 #endif // BOOST_LOG_WITHOUT_EVENT_LOG
88 #endif // BOOST_LOG_SINKS_EVENT_LOG_CONSTANTS_HPP_INCLUDED_