Chris@16: /* Chris@101: * Copyright Andrey Semashev 2007 - 2015. Chris@16: * Distributed under the Boost Software License, Version 1.0. Chris@16: * (See accompanying file LICENSE_1_0.txt or copy at Chris@16: * http://www.boost.org/LICENSE_1_0.txt) Chris@16: */ Chris@16: /*! Chris@16: * \file event_log_constants.hpp Chris@16: * \author Andrey Semashev Chris@16: * \date 07.11.2008 Chris@16: * Chris@16: * The header contains definition of constants related to Windows NT Event Log API. Chris@16: * The constants can be used in other places without the event log backend. Chris@16: */ Chris@16: Chris@16: #ifndef BOOST_LOG_SINKS_EVENT_LOG_CONSTANTS_HPP_INCLUDED_ Chris@16: #define BOOST_LOG_SINKS_EVENT_LOG_CONSTANTS_HPP_INCLUDED_ Chris@16: Chris@16: #include Chris@16: Chris@16: #ifdef BOOST_HAS_PRAGMA_ONCE Chris@16: #pragma once Chris@16: #endif Chris@16: Chris@16: #ifndef BOOST_LOG_WITHOUT_EVENT_LOG Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: Chris@16: BOOST_LOG_OPEN_NAMESPACE Chris@16: Chris@16: namespace sinks { Chris@16: Chris@16: namespace event_log { Chris@16: Chris@16: struct event_id_tag; Chris@16: //! A tagged integral type that represents event identifier for the Windows API Chris@16: typedef boost::log::aux::tagged_integer< unsigned int, event_id_tag > event_id; Chris@16: /*! Chris@16: * The function constructs event identifier from an integer Chris@16: */ Chris@16: inline event_id make_event_id(unsigned int id) Chris@16: { Chris@16: event_id iden = { id }; Chris@16: return iden; Chris@16: } Chris@16: Chris@16: struct event_category_tag; Chris@16: //! A tagged integral type that represents event category for the Windows API Chris@16: typedef boost::log::aux::tagged_integer< unsigned short, event_category_tag > event_category; Chris@16: /*! Chris@16: * The function constructs event category from an integer Chris@16: */ Chris@16: inline event_category make_event_category(unsigned short cat) Chris@16: { Chris@16: event_category category = { cat }; Chris@16: return category; Chris@16: } Chris@16: Chris@16: //! Windows event types Chris@16: enum event_type Chris@16: { Chris@16: success = 0, //!< Equivalent to EVENTLOG_SUCCESS Chris@16: info = 4, //!< Equivalent to EVENTLOG_INFORMATION_TYPE Chris@16: warning = 2, //!< Equivalent to EVENTLOG_WARNING_TYPE Chris@16: error = 1 //!< Equivalent to EVENTLOG_ERROR_TYPE Chris@16: }; Chris@16: Chris@16: /*! Chris@16: * The function constructs log record level from an integer Chris@16: */ Chris@16: BOOST_LOG_API event_type make_event_type(unsigned short lev); Chris@16: Chris@16: } // namespace event_log Chris@16: Chris@16: } // namespace sinks Chris@16: Chris@16: BOOST_LOG_CLOSE_NAMESPACE // namespace log Chris@16: Chris@16: } // namespace boost Chris@16: Chris@16: #include Chris@16: Chris@16: #endif // BOOST_LOG_WITHOUT_EVENT_LOG Chris@16: Chris@16: #endif // BOOST_LOG_SINKS_EVENT_LOG_CONSTANTS_HPP_INCLUDED_