CARMA C++
Syslog2DBMSConversions.h
Go to the documentation of this file.
1 #ifndef CARMA_DBMS_SYSLOG2DBMSCONVERSIONS_H
2 #define CARMA_DBMS_SYSLOG2DBMSCONVERSIONS_H
3 
12 #include "carma/dbms/Typedefs.h"
13 #include <string>
14 
15 namespace carma {
16 namespace dbms {
17 
18 
30  static const dbPriorityType UNKNOWN = 10;
31  static const dbPriorityType NOTSET = 20;
32  static const dbPriorityType DEBUG = 25;
33  static const dbPriorityType INFO = 30;
34  static const dbPriorityType NOTICE = 40;
35  static const dbPriorityType WARN = 50;
36  static const dbPriorityType ERROR = 60;
37  static const dbPriorityType CRIT = 70;
38  static const dbPriorityType ALERT = 80;
39  static const dbPriorityType FATAL = 90;
40  /*
41  typedef enum DB_PRIORITY {
42  UNKNOWN_PRIORITY,
43  NOTSET_PRIORITY,
44  DEBUG__PRIORITY,
45  INFO_PRIORITY,
46  NOTICE_PRIORITY,
47  WARN_PRIORITY,
48  ERROR_PRIORITY,
49  CRIT_PRIORITY,
50  ALERT_PRIORITY,
51  FATAL_PRIORITY
52  };
53  */
54 
59  dbPriorityType priority2DB(const std::string& priority);
60 
64  const std::string& db2Priority (const dbPriorityType dbPriority);
65 
66  const PriorityMap getDB2PriorityMap();
67 
68 
74  static const std::string UNKNOWN_STR ( "UNKNOWN" );
75  static const std::string NOTSET_STR ( "NOTSET" );
76  static const std::string DEBUG_STR ( "DEBUG" );
77  static const std::string INFO_STR ( "INFO" );
78  static const std::string NOTICE_STR ( "NOTICE" );
79  static const std::string WARN_STR ( "WARN" );
80  static const std::string ERROR_STR ( "ERROR" );
81  static const std::string ALERT_STR ( "ALERT" );
82  static const std::string CRIT_STR ( "CRIT" );
83  static const std::string FATAL_STR ( "FATAL" );
84 
85 }}
86 
87 #endif
unsigned short dbPriorityType
Database priority level.
Definition: Typedefs.h:30
dbPriorityType priority2DB(const std::string &priority)
convert the syslog priority string to the value which is written in the db
std::map< const dbPriorityType, const std::string > PriorityMap
A map of DB priority levels -&gt; syslog priority (string) levels.
Definition: Typedefs.h:35
const std::string & db2Priority(const dbPriorityType dbPriority)
convert a db value to its syslog priority string
typdefs for carma::dbms.