Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:39:25

0001 /*
0002  *          Copyright Andrey Semashev 2007 - 2015.
0003  * Distributed under the Boost Software License, Version 1.0.
0004  *    (See accompanying file LICENSE_1_0.txt or copy at
0005  *          http://www.boost.org/LICENSE_1_0.txt)
0006  */
0007 /*!
0008  * \file   event_log_constants.hpp
0009  * \author Andrey Semashev
0010  * \date   07.11.2008
0011  *
0012  * The header contains definition of constants related to Windows NT Event Log API.
0013  * The constants can be used in other places without the event log backend.
0014  */
0015 
0016 #ifndef BOOST_LOG_SINKS_EVENT_LOG_CONSTANTS_HPP_INCLUDED_
0017 #define BOOST_LOG_SINKS_EVENT_LOG_CONSTANTS_HPP_INCLUDED_
0018 
0019 #include <boost/log/detail/config.hpp>
0020 
0021 #ifdef BOOST_HAS_PRAGMA_ONCE
0022 #pragma once
0023 #endif
0024 
0025 #ifndef BOOST_LOG_WITHOUT_EVENT_LOG
0026 
0027 #include <boost/log/detail/tagged_integer.hpp>
0028 #include <boost/log/detail/header.hpp>
0029 
0030 namespace boost {
0031 
0032 BOOST_LOG_OPEN_NAMESPACE
0033 
0034 namespace sinks {
0035 
0036 namespace event_log {
0037 
0038     struct event_id_tag;
0039     //! A tagged integral type that represents event identifier for the Windows API
0040     typedef boost::log::aux::tagged_integer< unsigned int, event_id_tag > event_id;
0041     /*!
0042      * The function constructs event identifier from an integer
0043      */
0044     inline event_id make_event_id(unsigned int id)
0045     {
0046         event_id iden = { id };
0047         return iden;
0048     }
0049 
0050     struct event_category_tag;
0051     //! A tagged integral type that represents event category for the Windows API
0052     typedef boost::log::aux::tagged_integer< unsigned short, event_category_tag > event_category;
0053     /*!
0054      * The function constructs event category from an integer
0055      */
0056     inline event_category make_event_category(unsigned short cat)
0057     {
0058         event_category category = { cat };
0059         return category;
0060     }
0061 
0062     //! Windows event types
0063     enum event_type
0064     {
0065         success = 0,                 //!< Equivalent to EVENTLOG_SUCCESS
0066         info = 4,                    //!< Equivalent to EVENTLOG_INFORMATION_TYPE
0067         warning = 2,                 //!< Equivalent to EVENTLOG_WARNING_TYPE
0068         error = 1                    //!< Equivalent to EVENTLOG_ERROR_TYPE
0069     };
0070 
0071     /*!
0072      * The function constructs log record level from an integer
0073      */
0074     BOOST_LOG_API event_type make_event_type(unsigned short lev);
0075 
0076 } // namespace event_log
0077 
0078 } // namespace sinks
0079 
0080 BOOST_LOG_CLOSE_NAMESPACE // namespace log
0081 
0082 } // namespace boost
0083 
0084 #include <boost/log/detail/footer.hpp>
0085 
0086 #endif // BOOST_LOG_WITHOUT_EVENT_LOG
0087 
0088 #endif // BOOST_LOG_SINKS_EVENT_LOG_CONSTANTS_HPP_INCLUDED_