-/*\r
+/*!\r
* @file logger.h\r
* @brief logger module creation class.\r
*\r
*\r
**********************************************************************/\r
\r
-#ifndef __LOGGER_H__\r
-#define __LOGGER_H__\r
+#ifndef LOGGER_H\r
+#define LOGGER_H\r
\r
#include <string>\r
#include <logger_enum.h>\r
+namespace l7vs{\r
\r
-#define BUF_LEN (4096)\r
-#define DEBUG_STR_LEN (4096)\r
+//! @class Logger\r
+//! @brief Logger creation class.\r
+//! @brief this class create Logger Inmlement class and mediate function.\r
+class Logger{\r
+public:\r
+ //! default constructor creates implement class.\r
+ Logger();\r
\r
-namespace l7vs\r
-{\r
- /*!\r
- * Logger creation class.\r
- * this class create Logger Inmlement class and mediate function.\r
- */\r
- class Logger\r
- {\r
- public:\r
- //! default constructor creates implement class.\r
- Logger();\r
- //! destructor.\r
- ~Logger();\r
- /*!\r
- * returns single instance.\r
- *\r
- * @param void\r
- * @return instance\r
- */ \r
- static Logger& getInstance() {\r
- return instance;\r
- }\r
- //! load Configuration.\r
- void loadConf();\r
- //! retrieve category's log level.\r
- LOG_LEVEL_TAG getLogLevel(LOG_CATEGORY_TAG cat);\r
- //! set category's log level.\r
- bool setLogLevel(LOG_CATEGORY_TAG cat, LOG_LEVEL_TAG level);\r
- //! output fatal log.\r
- void putLogFatal(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line);\r
- //! output error log.\r
- void putLogError(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line);\r
- //! output warn log.\r
- void putLogWarn(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line);\r
- //! output info log.\r
- void putLogInfo(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line);\r
- //! output debug log.\r
- void putLogDebug(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line);\r
+ //! log output constractor\r
+ //! scoped log output( Logger destractor output log)\r
+ //! @param[in] Log output category tag\r
+ //! @param[in] log id\r
+ //! @param[in] log message\r
+ //! @param[in] filename (=__FILE__)\r
+ //! @param[in] lineno (=__LINE__)\r
+ Logger( LOG_CATEGORY_TAG, const unsigned int, const std::string&, const char*, int );\r
+\r
+ //! destructor.(output log then use log output constractor)\r
+ ~Logger();\r
+\r
+ //! load Configuration.\r
+ void loadConf();\r
+\r
+ //! retrieve category's log level.\r
+ //! @param[in] logcategory\r
+ //! @return loglevel\r
+ static LOG_LEVEL_TAG getLogLevel( LOG_CATEGORY_TAG );\r
+\r
+ //! set category's log level.\r
+ //! @param[in] logcategory\r
+ //! @param[in] loglevel\r
+ //! @return true success loglevel change\r
+ //! @return false failer loglevel change\r
+ bool setLogLevel(LOG_CATEGORY_TAG cat, LOG_LEVEL_TAG level);\r
+\r
+ //! output fatal log.\r
+ //! @param[in] Log output category tag\r
+ //! @param[in] log id\r
+ //! @param[in] log message\r
+ //! @param[in] filename (=__FILE__)\r
+ //! @param[in] lineno (=__LINE__)\r
+ void putLogFatal( LOG_CATEGORY_TAG, const unsigned int, const std::string&, const char*, int );\r
+\r
+ //! output error log.\r
+ //! @param[in] Log output category tag\r
+ //! @param[in] log id\r
+ //! @param[in] log message\r
+ //! @param[in] filename (=__FILE__)\r
+ //! @param[in] lineno (=__LINE__)\r
+ void putLogError(LOG_CATEGORY_TAG, const unsigned int, const std::string&, const char*, int );\r
+\r
+ //! output warn log.\r
+ //! @param[in] Log output category tag\r
+ //! @param[in] log id\r
+ //! @param[in] log message\r
+ //! @param[in] filename (=__FILE__)\r
+ //! @param[in] lineno (=__LINE__)\r
+ void putLogWarn(LOG_CATEGORY_TAG, const unsigned int, const std::string&, const char*, int );\r
+\r
+ //! output info log.\r
+ //! @param[in] Log output category tag\r
+ //! @param[in] log id\r
+ //! @param[in] log message\r
+ //! @param[in] filename (=__FILE__)\r
+ //! @param[in] lineno (=__LINE__)\r
+ void putLogInfo(LOG_CATEGORY_TAG, const unsigned int, const std::string&, const char*, int );\r
+\r
+ //! output debug log.\r
+ //! @param[in] Log output category tag\r
+ //! @param[in] log id\r
+ //! @param[in] log message\r
+ //! @param[in] filename (=__FILE__)\r
+ //! @param[in] lineno (=__LINE__)\r
+ void putLogDebug(LOG_CATEGORY_TAG, const unsigned int, const std::string&, const char*, int );\r
+};\r
\r
- protected:\r
- /*!\r
- * static instance initialize before main. \r
- * instance will defined in main program.\r
- */\r
- static Logger instance;\r
- };\r
} //namespace l7vs\r
\r
-#endif //__LOGGER_H__\r
+#endif //LOGGER_H\r
-/*\r
+/*!\r
* @file logger_enum.h\r
* @brief logger module constants enumeration.\r
*\r
#ifndef LOGGER_ENUM_H\r
#define LOGGER_ENUM_H\r
\r
-#include <string>\r
#include <log4cxx/level.h>\r
\r
namespace l7vs{\r
\r
-/*!\r
- * LogLevel enumeration.\r
- */\r
-enum LOG_LEVEL_TAG\r
-{\r
- LOG_LV_NONE = 0,\r
- LOG_LV_DEBUG,\r
- LOG_LV_INFO,\r
- LOG_LV_WARN,\r
- LOG_LV_ERROR,\r
- LOG_LV_FATAL\r
+//! @enum LOG_LV_TAG\r
+//! @brief LogLevel enumeration.\r
+enum LOG_LEVEL_TAG {\r
+ LOG_LV_NONE = 0, //!< loglevel is none\r
+ LOG_LV_DEBUG, //!< loglevel is debug\r
+ LOG_LV_INFO, //!< loglevel is info\r
+ LOG_LV_WARN, //!< loglevel is warn\r
+ LOG_LV_ERROR, //!< loglevel is error\r
+ LOG_LV_FATAL //!< loglevel is fatal\r
};\r
\r
+//! loglevel enum incliment function\r
+//! @param[in] logleveltag refarence\r
+//! @return logleveltag reference\r
inline LOG_LEVEL_TAG& operator++(LOG_LEVEL_TAG& level) {\r
level = static_cast<LOG_LEVEL_TAG>(level + 1);\r
return level;\r
}\r
\r
-/*!\r
- * Category enumeration.\r
- * LOG_CAT_SSLPROXY_LOGGER should be first for logger log.\r
- */\r
-enum LOG_CATEGORY_TAG\r
-{\r
- LOG_CAT_NONE = 0,\r
-\r
- LOG_CAT_L7VSD_NETWORK,\r
- LOG_CAT_L7VSD_NETWORK_QOS,\r
- LOG_CAT_L7VSD_NETWORK_BANDWIDTH,\r
- LOG_CAT_L7VSD_NETWORK_NUM_CONNECTION,\r
- LOG_CAT_L7VSD_MAINTHREAD,\r
- LOG_CAT_L7VSD_VIRTUALSERVICE,\r
- LOG_CAT_L7VSD_VIRTUALSERVICE_THRAD,\r
- LOG_CAT_L7VSD_SESSION,\r
- LOG_CAT_L7VSD_SESSION_THREAD,\r
- LOG_CAT_L7VSD_SORRYSERVER,\r
- LOG_CAT_L7VSD_MODULE,\r
- LOG_CAT_L7VSD_SCHEDULE,\r
- LOG_CAT_L7VSD_PROTOCOL,\r
- LOG_CAT_L7VSD_REPLICATION,\r
- LOG_CAT_L7VSD_PARAMTER,\r
- LOG_CAT_L7VSD_LOGGER,\r
- LOG_CAT_L7VSD_COMMAND,\r
- LOG_CAT_L7VSD_START_STOP,\r
- LOG_CAT_L7VSD_SYSTEM,\r
- LOG_CAT_L7VSD_SYSTEM_MEMORY,\r
- LOG_CAT_L7VSD_SYSTEM_ENDPOINT,\r
- LOG_CAT_L7VSD_SYSTEM_SIGNAL,\r
- LOG_CAT_L7VSD_SYSTEM_ENVIRONMENT,\r
-\r
- LOG_CAT_L7VSADM_PARSE,\r
- LOG_CAT_L7VSADM_OPERATE,\r
- LOG_CAT_l7VSADM_CONFIG_RESULT,\r
- LOG_CAT_L7VSADM_COMMON,\r
- LOG_CAT_L7VSADM_LOGGER,\r
- LOG_CAT_L7VSADM_PARAMETER,\r
- LOG_CAT_L7VSADM_PROTOCOL,\r
- LOG_CAT_L7VSADM_MODULE,\r
-\r
- LOG_CAT_SNMPAGENT_START_STOP,\r
- LOG_CAT_SNMPAGENT_MANAGER_RECEIVE,\r
- LOG_CAT_SNMPAGENT_MANAGER_SEND,\r
- LOG_CAT_SNMPAGENT_L7VSD_RECEIVE,\r
- LOG_CAT_SNMPAGENT_L7VSD_SEND,\r
- LOG_CAT_SNMPAGENT_LOGGER,\r
- LOG_CAT_SNMPAGENT_PARAMETER,\r
-\r
- LOG_CAT_SSLPROXY_LOGGER,\r
- LOG_CAT_SSLPROXY_PARAMETER,\r
- LOG_CAT_SSLPROXY_COMMON,\r
- LOG_CAT_SSLPROXY_SERVER,\r
- LOG_CAT_SSLPROXY_SESSION,\r
- LOG_CAT_SSLPROXY_CONNECTION,\r
- LOG_CAT_END\r
+//! @enum LOG_CATEGORY_TAG\r
+//! @brief Category enumeration.\r
+//! @brief LOG_CAT_SSLPROXY_LOGGER should be first for logger log.\r
+enum LOG_CATEGORY_TAG{\r
+ LOG_CAT_NONE = 0, //!< logcategory is none\r
+ LOG_CAT_L7VSD_NETWORK, //!< logcategory is network\r
+ LOG_CAT_L7VSD_NETWORK_QOS, //!< logcategory is QoS\r
+ LOG_CAT_L7VSD_NETWORK_BANDWIDTH, //!< logcategory is bps\r
+ LOG_CAT_L7VSD_NETWORK_NUM_CONNECTION, //!< logcategory is connection count \r
+ LOG_CAT_L7VSD_MAINTHREAD, //!< logcategory is mainthread\r
+ LOG_CAT_L7VSD_VIRTUALSERVICE_THRAD, //!< logcategory is virtualservice thread\r
+ LOG_CAT_L7VSD_SESSION_THREAD, //!< logcategory is session thread\r
+ LOG_CAT_L7VSD_MODULE, //!< logcategory is module controler\r
+ LOG_CAT_L7VSD_SCHEDULE, //!< logcategory is schedule module( caution! module_controller bind )\r
+ LOG_CAT_L7VSD_PROTOCOL, //!< logcategory is protocol module( caution! module_controller bind )\r
+ LOG_CAT_L7VSD_REPLICATION, //!< logcategory is replication\r
+ LOG_CAT_L7VSD_PARAMTER, //!< logcategory is parameter\r
+ LOG_CAT_L7VSD_LOGGER, //!< logcategory is logger\r
+ LOG_CAT_L7VSD_COMMAND, //!< logcategory is command reciver\r
+ LOG_CAT_L7VSD_START_STOP, //!< logcategory is main function used\r
+ LOG_CAT_L7VSD_SYSTEM, //!< logcategory is systemcall other\r
+ LOG_CAT_L7VSD_SYSTEM_MEMORY, //!< logcategory is systemcall memory\r
+ LOG_CAT_L7VSD_SYSTEM_ENDPOINT, //!< logcategory is systemcall socket \r
+ LOG_CAT_L7VSD_SYSTEM_SIGNAL, //!< logcategory is systemcall signal\r
+ LOG_CAT_L7VSD_SYSTEM_ENVIRONMENT, //!< logcategory is systemcall env\r
+\r
+ LOG_CAT_L7VSADM_PARSE, //!< logcategory is parse\r
+ LOG_CAT_L7VSADM_OPERATE, //!< logcategory is operate\r
+ LOG_CAT_l7VSADM_CONFIG_RESULT, //!< logcategory is configure\r
+ LOG_CAT_L7VSADM_COMMON, //!< logcategory is other\r
+ LOG_CAT_L7VSADM_LOGGER, //!< logcategory is logger\r
+ LOG_CAT_L7VSADM_PARAMETER, //!< logcategory is parameter\r
+ LOG_CAT_L7VSADM_PROTOCOL, //!< logcategory is protocol module\r
+ LOG_CAT_L7VSADM_MODULE, //!< logcategory is module control\r
+\r
+ LOG_CAT_SNMPAGENT_START_STOP, //!< logcategory is snmpagent main\r
+ LOG_CAT_SNMPAGENT_MANAGER_RECEIVE, //!< logcategory is manager send\r
+ LOG_CAT_SNMPAGENT_MANAGER_SEND, //!< logcategory is manager recv\r
+ LOG_CAT_SNMPAGENT_L7VSD_RECEIVE, //!< logcategory is snmpbrigde recv\r
+ LOG_CAT_SNMPAGENT_L7VSD_SEND, //!< logcategory is snmpbrigre send\r
+ LOG_CAT_SNMPAGENT_LOGGER, //!< logcategory is manager logger\r
+ LOG_CAT_SNMPAGENT_PARAMETER, //!< logcategory is manager parameter\r
+\r
+ LOG_CAT_SSLPROXY_LOGGER, //!< logcategory is snmpproxy logger\r
+ LOG_CAT_SSLPROXY_PARAMETER, //!< logcategory is snmpproxy parameter\r
+ LOG_CAT_SSLPROXY_COMMON, //!< logcategory is snmpproxy common\r
+ LOG_CAT_SSLPROXY_SERVER, //!< logcategory is snmpproxy server\r
+ LOG_CAT_SSLPROXY_SESSION, //!< logcategory is snmpproxy session\r
+ LOG_CAT_SSLPROXY_CONNECTION, //!< logcategory is snmpproxy connection\r
+ LOG_CAT_END //!< end of logcategory\r
};\r
\r
\r
+//! logcategory enum incliment function\r
+//! @param[in] logcategorytag refarence\r
+//! @return logcategorytag reference\r
inline LOG_CATEGORY_TAG& operator++(LOG_CATEGORY_TAG& cat) {\r
cat = static_cast<LOG_CATEGORY_TAG>(cat + 1);\r
return cat;\r
}\r
\r
-/*!\r
- * Rotation enumeration.\r
- */\r
-enum LOG_ROTATION_TAG {\r
- LOG_ROT_SIZE,\r
- LOG_ROT_DATE,\r
- LOG_ROT_DATESIZE\r
-};\r
-\r
-/*!\r
- * RotationTiming enumeration.\r
- */\r
-enum LOG_ROTATION_TIMING_TAG {\r
- LOG_TIM_YEAR,\r
- LOG_TIM_MONTH,\r
- LOG_TIM_WEEK,\r
- LOG_TIM_DATE,\r
- LOG_TIM_HOUR\r
-};\r
-\r
-\r
-}; //namespace l7vs \r
+} //namespace l7vs\r
#endif //__LOGGER_ENUM_H__\r