Wolframe, 0.0.3

logSyslogFacility.hpp
Go to the documentation of this file.
1 /************************************************************************
2 
3  Copyright (C) 2011 - 2014 Project Wolframe.
4  All rights reserved.
5 
6  This file is part of Project Wolframe.
7 
8  Commercial Usage
9  Licensees holding valid Project Wolframe Commercial licenses may
10  use this file in accordance with the Project Wolframe
11  Commercial License Agreement provided with the Software or,
12  alternatively, in accordance with the terms contained
13  in a written agreement between the licensee and Project Wolframe.
14 
15  GNU General Public License Usage
16  Alternatively, you can redistribute this file and/or modify it
17  under the terms of the GNU General Public License as published by
18  the Free Software Foundation, either version 3 of the License, or
19  (at your option) any later version.
20 
21  Wolframe is distributed in the hope that it will be useful,
22  but WITHOUT ANY WARRANTY; without even the implied warranty of
23  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  GNU General Public License for more details.
25 
26  You should have received a copy of the GNU General Public License
27  along with Wolframe. If not, see <http://www.gnu.org/licenses/>.
28 
29  If you have questions regarding the use of this file, please contact
30  Project Wolframe.
31 
32 ************************************************************************/
37 
38 #ifndef _LOG_SYSLOG_FACILITY_HPP_INCLUDED
39 #define _LOG_SYSLOG_FACILITY_HPP_INCLUDED
40 
41 #if defined( _MSC_VER )
42  #define WOLFRAME_EXPORT __declspec( dllexport )
43 #else
44  #define WOLFRAME_EXPORT
45 #endif
46 
47 #include <string>
48 #include <iosfwd>
49 
50 namespace _Wolframe {
51 namespace log {
52 
56 public:
57  enum Facility {
82  WOLFRAME_SYSLOG_FACILITY_UNDEFINED
83  };
84 
86  static Facility strToSyslogFacility( const std::string& str );
87 };
88 
90 template< typename CharT, typename TraitsT >
91 inline std::basic_ostream< CharT, TraitsT > &operator<< ( std::basic_ostream< CharT, TraitsT >& s,
93 {
94  static const CharT *const str[] = {
95  "KERN", "USER", "MAIL", "DAEMON", "AUTH", "SYSLOG", "LPR",
96  "NEWS", "UUCP", "CRON", "AUTHPRIV", "FTP", "NTP", "SECURITY",
97  "CONSOLE", "AUDIT", "LOCAL0", "LOCAL1", "LOCAL2", "LOCAL3",
98  "LOCAL4", "LOCAL5", "LOCAL6", "LOCAL7" };
99  if( static_cast< size_t >( f ) < ( sizeof( str ) / sizeof( *str ) ) ) {
100  s << str[f];
101  } else {
102  s << "Unknown enum used '" << static_cast< int >( f ) << "'";
103  }
104  return s;
105 }
106 
107 }} // namespace _Wolframe::log
108 
109 #endif // _LOG_SYSLOG_FACILITY_HPP_INCLUDED
FTP daemon.
Definition: logSyslogFacility.hpp:69
local facility 6
Definition: logSyslogFacility.hpp:80
system daemons
Definition: logSyslogFacility.hpp:61
network news subsystem
Definition: logSyslogFacility.hpp:65
security/authorization messages
Definition: logSyslogFacility.hpp:62
local facility 4
Definition: logSyslogFacility.hpp:78
security/authorization messages
Definition: logSyslogFacility.hpp:68
messages generated internally by syslog
Definition: logSyslogFacility.hpp:63
Facility
Definition: logSyslogFacility.hpp:57
Facility (sink) for syslog.
Definition: logSyslogFacility.hpp:55
NTP daemon (on FreeBSD)
Definition: logSyslogFacility.hpp:70
local facility 7
Definition: logSyslogFacility.hpp:81
#define WOLFRAME_EXPORT
Definition: logSyslogFacility.hpp:44
local facility 2
Definition: logSyslogFacility.hpp:76
random user-level messages
Definition: logSyslogFacility.hpp:59
local facility 5
Definition: logSyslogFacility.hpp:79
local facility 3
Definition: logSyslogFacility.hpp:77
UUCP subsystem.
Definition: logSyslogFacility.hpp:66
local facility 0
Definition: logSyslogFacility.hpp:74
audit (on Solaris 10)
Definition: logSyslogFacility.hpp:73
cron/at daemons
Definition: logSyslogFacility.hpp:67
local facility 1
Definition: logSyslogFacility.hpp:75
line printer subsystem
Definition: logSyslogFacility.hpp:64
/dev/console output (on FreeBSD)
Definition: logSyslogFacility.hpp:72
security subsystem (on FreeBSD)
Definition: logSyslogFacility.hpp:71
kernel messages
Definition: logSyslogFacility.hpp:58
mail system
Definition: logSyslogFacility.hpp:60