OSDN Git Service

Merge branch 'packet_edit' into autotools-fix(releng)
[ultramonkey-l7/sslproxy.git] / logger / logger.cpp
index 29d38a7..f76dfa2 100644 (file)
-/*\r
- * @file  logger.cpp\r
- * @brief logger module creation class.\r
- *\r
- * L7VSD: Linux Virtual Server for Layer7 Load Balancing\r
- * Copyright (C) 2008  NTT COMWARE Corporation.\r
- *\r
- * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Lesser General Public\r
- * License as published by the Free Software Foundation; either\r
- * version 2.1 of the License, or (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
- * Lesser General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Lesser General Public\r
- * License along with this library; if not, write to the Free Software\r
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\r
- * 02110-1301 USA\r
- *\r
- **********************************************************************/\r
-\r
-#include <logger.h>\r
-#include <logger_impl.h>\r
-\r
-/*!\r
- * default constructor.\r
- * get instance of implement class, and initialize\r
- * @param   void\r
- * @return  void\r
- */\r
-l7vs::Logger::Logger()\r
-{\r
-       if (!LoggerImpl::getInstance().init()) {\r
-               exit(1);\r
-       }\r
-}\r
-\r
-/*!\r
- * destructor.\r
- * @param   void\r
- * @return  void\r
- */\r
-l7vs::Logger::~Logger()\r
-{\r
-}\r
-\r
-/*!\r
- * retrieve category's log level.\r
- * this is only wrapper to implement method.\r
- * @param   category that want to know\r
- * @return  log level\r
- */\r
-LOG_LEVEL_TAG l7vs::Logger::getLogLevel(LOG_CATEGORY_TAG cat)\r
-{\r
-       return LoggerImpl::getInstance().getLogLevel(cat);\r
-}\r
-\r
-/*!\r
- * set category's log level.\r
- * this is only wrapper to implement method.\r
- * @param   category to set log level\r
- * @param   level\r
- * @retval  true  succeed\r
- * @retval  false failed\r
- */\r
-bool l7vs::Logger::setLogLevel(LOG_CATEGORY_TAG cat, LOG_LEVEL_TAG level)\r
-{\r
-       return LoggerImpl::getInstance().setLogLevel(cat, level);\r
-}\r
-\r
-/*!\r
- * output fatal log.\r
- * this is only wrapper to implement method.\r
- * @param   category that logging matter occured\r
- * @param   log message id \r
- * @param   log message \r
- * @param   current file \r
- * @param   current line\r
- * @retrun  void\r
- */\r
-void l7vs::Logger::putLogFatal(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)\r
-{\r
-       LoggerImpl::getInstance().putLogFatal(cat, message_id, message, file, line);\r
-}\r
-\r
-/*!\r
- * output errorl log.\r
- * this is only wrapper to implement method.\r
- * @param   category that logging matter occured\r
- * @param   log message id \r
- * @param   log message \r
- * @param   current file \r
- * @param   current line\r
- * @retrun  void\r
- */\r
-void l7vs::Logger::putLogError(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)\r
-{\r
-       LoggerImpl::getInstance().putLogError(cat, message_id, message, file, line);\r
-}\r
-\r
-/*!\r
- * output warn log.\r
- * this is only wrapper to implement method.\r
- * @param   category that logging matter occured\r
- * @param   log message id \r
- * @param   log message \r
- * @param   current file \r
- * @param   current line\r
- * @retrun  void\r
- */\r
-void l7vs::Logger::putLogWarn(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)\r
-{\r
-       LoggerImpl::getInstance().putLogWarn(cat, message_id, message, file, line);\r
-}\r
-\r
-/*!\r
- * output info log.\r
- * this is only wrapper to implement method.\r
- * @param   category that logging matter occured\r
- * @param   log message id \r
- * @param   log message \r
- * @param   current file \r
- * @param   current line\r
- * @retrun  void\r
- */\r
-void l7vs::Logger::putLogInfo(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)\r
-{\r
-       LoggerImpl::getInstance().putLogInfo(cat, message_id, message, file, line);\r
-}\r
-\r
-/*!\r
- * output debug log.\r
- * this is only wrapper to implement method.\r
- * @param   category that logging matter occured\r
- * @param   log message id \r
- * @param   log message \r
- * @param   current file \r
- * @param   current line\r
- * @retrun  void\r
- */\r
-void l7vs::Logger::putLogDebug(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)\r
-{\r
-       LoggerImpl::getInstance().putLogDebug(cat, message_id, message, file, line);\r
-}\r
-\r
-/*!\r
- * reload configuration.\r
- * this is only wrapper to implement method.\r
- * @param   void\r
- * @return  void\r
- */\r
-void l7vs::Logger::loadConf()\r
-{\r
-       LoggerImpl::getInstance().loadConf();\r
-}\r
+/*
+ * @file  logger.cpp
+ * @brief logger module creation class.
+ *
+ * L7VSD: Linux Virtual Server for Layer7 Load Balancing
+ * Copyright (C) 2008  NTT COMWARE Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ **********************************************************************/
+
+#include <logger.h>
+#include <logger_impl.h>
+
+/*!
+ * default constructor.
+ * get instance of implement class, and initialize
+ * @param   void
+ * @return  void
+ */
+l7vs::Logger::Logger()
+{
+       if (!LoggerImpl::getInstance().init()) {
+               exit(1);
+       }
+}
+
+/*!
+ * destructor.
+ * @param   void
+ * @return  void
+ */
+l7vs::Logger::~Logger()
+{
+}
+
+/*!
+ * retrieve category's log level.
+ * this is only wrapper to implement method.
+ * @param   category that want to know
+ * @return  log level
+ */
+LOG_LEVEL_TAG l7vs::Logger::getLogLevel(LOG_CATEGORY_TAG cat)
+{
+       return LoggerImpl::getInstance().getLogLevel(cat);
+}
+
+/*!
+ * set category's log level.
+ * this is only wrapper to implement method.
+ * @param   category to set log level
+ * @param   level
+ * @retval  true  succeed
+ * @retval  false failed
+ */
+bool l7vs::Logger::setLogLevel(LOG_CATEGORY_TAG cat, LOG_LEVEL_TAG level)
+{
+       return LoggerImpl::getInstance().setLogLevel(cat, level);
+}
+
+/*!
+ * output fatal log.
+ * this is only wrapper to implement method.
+ * @param   category that logging matter occured
+ * @param   log message id 
+ * @param   log message 
+ * @param   current file 
+ * @param   current line
+ * @retrun  void
+ */
+void l7vs::Logger::putLogFatal(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)
+{
+       LoggerImpl::getInstance().putLogFatal(cat, message_id, message, file, line);
+}
+
+/*!
+ * output errorl log.
+ * this is only wrapper to implement method.
+ * @param   category that logging matter occured
+ * @param   log message id 
+ * @param   log message 
+ * @param   current file 
+ * @param   current line
+ * @retrun  void
+ */
+void l7vs::Logger::putLogError(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)
+{
+       LoggerImpl::getInstance().putLogError(cat, message_id, message, file, line);
+}
+
+/*!
+ * output warn log.
+ * this is only wrapper to implement method.
+ * @param   category that logging matter occured
+ * @param   log message id 
+ * @param   log message 
+ * @param   current file 
+ * @param   current line
+ * @retrun  void
+ */
+void l7vs::Logger::putLogWarn(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)
+{
+       LoggerImpl::getInstance().putLogWarn(cat, message_id, message, file, line);
+}
+
+/*!
+ * output info log.
+ * this is only wrapper to implement method.
+ * @param   category that logging matter occured
+ * @param   log message id 
+ * @param   log message 
+ * @param   current file 
+ * @param   current line
+ * @retrun  void
+ */
+void l7vs::Logger::putLogInfo(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)
+{
+       LoggerImpl::getInstance().putLogInfo(cat, message_id, message, file, line);
+}
+
+/*!
+ * output debug log.
+ * this is only wrapper to implement method.
+ * @param   category that logging matter occured
+ * @param   log message id 
+ * @param   log message 
+ * @param   current file 
+ * @param   current line
+ * @retrun  void
+ */
+void l7vs::Logger::putLogDebug(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)
+{
+       LoggerImpl::getInstance().putLogDebug(cat, message_id, message, file, line);
+}
+
+/*!
+ * reload configuration.
+ * this is only wrapper to implement method.
+ * @param   void
+ * @return  void
+ */
+void l7vs::Logger::loadConf()
+{
+       LoggerImpl::getInstance().loadConf();
+}