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 syslog_constants.hpp Chris@16: * \author Andrey Semashev Chris@16: * \date 08.01.2008 Chris@16: * Chris@16: * The header contains definition of constants related to Syslog API. The constants can be Chris@16: * used in other places without the Syslog backend. Chris@16: */ Chris@16: Chris@16: #ifndef BOOST_LOG_SINKS_SYSLOG_CONSTANTS_HPP_INCLUDED_HPP_ Chris@16: #define BOOST_LOG_SINKS_SYSLOG_CONSTANTS_HPP_INCLUDED_HPP_ 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_SYSLOG Chris@16: 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 syslog { Chris@16: Chris@16: //! Syslog record levels Chris@16: enum level Chris@16: { Chris@16: emergency = 0, //!< Equivalent to LOG_EMERG in syslog API Chris@16: alert = 1, //!< Equivalent to LOG_ALERT in syslog API Chris@16: critical = 2, //!< Equivalent to LOG_CRIT in syslog API Chris@16: error = 3, //!< Equivalent to LOG_ERROR in syslog API Chris@16: warning = 4, //!< Equivalent to LOG_WARNING in syslog API Chris@16: notice = 5, //!< Equivalent to LOG_NOTICE in syslog API Chris@16: info = 6, //!< Equivalent to LOG_INFO in syslog API Chris@16: debug = 7 //!< Equivalent to LOG_DEBUG in syslog API Chris@16: }; Chris@16: Chris@16: /*! Chris@16: * The function constructs log record level from an integer Chris@16: */ Chris@16: BOOST_LOG_API level make_level(int lev); Chris@16: Chris@16: //! Syslog facility codes Chris@16: enum facility Chris@16: { Chris@16: kernel = 0 * 8, //!< Kernel messages Chris@16: user = 1 * 8, //!< User-level messages. Equivalent to LOG_USER in syslog API. Chris@16: mail = 2 * 8, //!< Mail system messages. Equivalent to LOG_MAIL in syslog API. Chris@16: daemon = 3 * 8, //!< System daemons. Equivalent to LOG_DAEMON in syslog API. Chris@16: security0 = 4 * 8, //!< Security/authorization messages Chris@16: syslogd = 5 * 8, //!< Messages from the syslogd daemon. Equivalent to LOG_SYSLOG in syslog API. Chris@16: printer = 6 * 8, //!< Line printer subsystem. Equivalent to LOG_LPR in syslog API. Chris@16: news = 7 * 8, //!< Network news subsystem. Equivalent to LOG_NEWS in syslog API. Chris@16: uucp = 8 * 8, //!< Messages from UUCP subsystem. Equivalent to LOG_UUCP in syslog API. Chris@16: clock0 = 9 * 8, //!< Messages from the clock daemon Chris@16: security1 = 10 * 8, //!< Security/authorization messages Chris@16: ftp = 11 * 8, //!< Messages from FTP daemon Chris@16: ntp = 12 * 8, //!< Messages from NTP daemon Chris@16: log_audit = 13 * 8, //!< Security/authorization messages Chris@16: log_alert = 14 * 8, //!< Security/authorization messages Chris@16: clock1 = 15 * 8, //!< Messages from the clock daemon Chris@16: local0 = 16 * 8, //!< For local use. Equivalent to LOG_LOCAL0 in syslog API Chris@16: local1 = 17 * 8, //!< For local use. Equivalent to LOG_LOCAL1 in syslog API Chris@16: local2 = 18 * 8, //!< For local use. Equivalent to LOG_LOCAL2 in syslog API Chris@16: local3 = 19 * 8, //!< For local use. Equivalent to LOG_LOCAL3 in syslog API Chris@16: local4 = 20 * 8, //!< For local use. Equivalent to LOG_LOCAL4 in syslog API Chris@16: local5 = 21 * 8, //!< For local use. Equivalent to LOG_LOCAL5 in syslog API Chris@16: local6 = 22 * 8, //!< For local use. Equivalent to LOG_LOCAL6 in syslog API Chris@16: local7 = 23 * 8 //!< For local use. Equivalent to LOG_LOCAL7 in syslog API Chris@16: }; Chris@16: Chris@16: /*! Chris@16: * The function constructs log source facility from an integer Chris@16: */ Chris@16: BOOST_LOG_API facility make_facility(int fac); Chris@16: Chris@16: } // namespace syslog 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_SYSLOG Chris@16: Chris@16: #endif // BOOST_LOG_SINKS_SYSLOG_CONSTANTS_HPP_INCLUDED_HPP_