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

source code of boost/libs/log/include/boost/log/sinks/syslog_constants.hpp