syslog_constants.hpp 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  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)
  6. */
  7. /*!
  8. * \file syslog_constants.hpp
  9. * \author Andrey Semashev
  10. * \date 08.01.2008
  11. *
  12. * The header contains definition of constants related to Syslog API. The constants can be
  13. * used in other places without the Syslog backend.
  14. */
  15. #ifndef BOOST_LOG_SINKS_SYSLOG_CONSTANTS_HPP_INCLUDED_HPP_
  16. #define BOOST_LOG_SINKS_SYSLOG_CONSTANTS_HPP_INCLUDED_HPP_
  17. #include <boost/log/detail/config.hpp>
  18. #ifdef BOOST_HAS_PRAGMA_ONCE
  19. #pragma once
  20. #endif
  21. #ifndef BOOST_LOG_WITHOUT_SYSLOG
  22. #include <boost/log/detail/header.hpp>
  23. namespace boost {
  24. BOOST_LOG_OPEN_NAMESPACE
  25. namespace sinks {
  26. namespace syslog {
  27. //! Syslog record levels
  28. enum level
  29. {
  30. emergency = 0, //!< Equivalent to LOG_EMERG in syslog API
  31. alert = 1, //!< Equivalent to LOG_ALERT in syslog API
  32. critical = 2, //!< Equivalent to LOG_CRIT in syslog API
  33. error = 3, //!< Equivalent to LOG_ERROR in syslog API
  34. warning = 4, //!< Equivalent to LOG_WARNING in syslog API
  35. notice = 5, //!< Equivalent to LOG_NOTICE in syslog API
  36. info = 6, //!< Equivalent to LOG_INFO in syslog API
  37. debug = 7 //!< Equivalent to LOG_DEBUG in syslog API
  38. };
  39. /*!
  40. * The function constructs log record level from an integer
  41. */
  42. BOOST_LOG_API level make_level(int lev);
  43. //! Syslog facility codes
  44. enum facility
  45. {
  46. kernel = 0 * 8, //!< Kernel messages
  47. user = 1 * 8, //!< User-level messages. Equivalent to LOG_USER in syslog API.
  48. mail = 2 * 8, //!< Mail system messages. Equivalent to LOG_MAIL in syslog API.
  49. daemon = 3 * 8, //!< System daemons. Equivalent to LOG_DAEMON in syslog API.
  50. security0 = 4 * 8, //!< Security/authorization messages
  51. syslogd = 5 * 8, //!< Messages from the syslogd daemon. Equivalent to LOG_SYSLOG in syslog API.
  52. printer = 6 * 8, //!< Line printer subsystem. Equivalent to LOG_LPR in syslog API.
  53. news = 7 * 8, //!< Network news subsystem. Equivalent to LOG_NEWS in syslog API.
  54. uucp = 8 * 8, //!< Messages from UUCP subsystem. Equivalent to LOG_UUCP in syslog API.
  55. clock0 = 9 * 8, //!< Messages from the clock daemon
  56. security1 = 10 * 8, //!< Security/authorization messages
  57. ftp = 11 * 8, //!< Messages from FTP daemon
  58. ntp = 12 * 8, //!< Messages from NTP daemon
  59. log_audit = 13 * 8, //!< Security/authorization messages
  60. log_alert = 14 * 8, //!< Security/authorization messages
  61. clock1 = 15 * 8, //!< Messages from the clock daemon
  62. local0 = 16 * 8, //!< For local use. Equivalent to LOG_LOCAL0 in syslog API
  63. local1 = 17 * 8, //!< For local use. Equivalent to LOG_LOCAL1 in syslog API
  64. local2 = 18 * 8, //!< For local use. Equivalent to LOG_LOCAL2 in syslog API
  65. local3 = 19 * 8, //!< For local use. Equivalent to LOG_LOCAL3 in syslog API
  66. local4 = 20 * 8, //!< For local use. Equivalent to LOG_LOCAL4 in syslog API
  67. local5 = 21 * 8, //!< For local use. Equivalent to LOG_LOCAL5 in syslog API
  68. local6 = 22 * 8, //!< For local use. Equivalent to LOG_LOCAL6 in syslog API
  69. local7 = 23 * 8 //!< For local use. Equivalent to LOG_LOCAL7 in syslog API
  70. };
  71. /*!
  72. * The function constructs log source facility from an integer
  73. */
  74. BOOST_LOG_API facility make_facility(int fac);
  75. } // namespace syslog
  76. } // namespace sinks
  77. BOOST_LOG_CLOSE_NAMESPACE // namespace log
  78. } // namespace boost
  79. #include <boost/log/detail/footer.hpp>
  80. #endif // BOOST_LOG_WITHOUT_SYSLOG
  81. #endif // BOOST_LOG_SINKS_SYSLOG_CONSTANTS_HPP_INCLUDED_HPP_