3 * @brief logger module creation class.
5 * L7VSD: Linux Virtual Server for Layer7 Load Balancing
6 * Copyright (C) 2008 NTT COMWARE Corporation.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23 **********************************************************************/
26 #include <logger_impl.h>
30 * default constructor.
31 * get instance of implement class, and initialize
35 l7vs::Logger::Logger()
37 if (!LoggerImpl::getInstance().init()) {
47 l7vs::Logger::~Logger()
52 * retrieve category's log level.
53 * this is only wrapper to implement method.
54 * @param category that want to know
57 LOG_LEVEL_TAG l7vs::Logger::getLogLevel(LOG_CATEGORY_TAG cat)
59 return LoggerImpl::getInstance().getLogLevel(cat);
63 * set category's log level.
64 * this is only wrapper to implement method.
65 * @param category to set log level
67 * @retval true succeed
68 * @retval false failed
70 bool l7vs::Logger::setLogLevel(LOG_CATEGORY_TAG cat, LOG_LEVEL_TAG level)
72 return LoggerImpl::getInstance().setLogLevel(cat, level);
77 * this is only wrapper to implement method.
78 * @param category that logging matter occured
79 * @param log message id
85 void l7vs::Logger::putLogFatal(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)
87 LoggerImpl::getInstance().putLogFatal(cat, message_id, message, file, line);
92 * this is only wrapper to implement method.
93 * @param category that logging matter occured
94 * @param log message id
100 void l7vs::Logger::putLogError(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)
102 LoggerImpl::getInstance().putLogError(cat, message_id, message, file, line);
107 * this is only wrapper to implement method.
108 * @param category that logging matter occured
109 * @param log message id
111 * @param current file
112 * @param current line
115 void l7vs::Logger::putLogWarn(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)
117 LoggerImpl::getInstance().putLogWarn(cat, message_id, message, file, line);
122 * this is only wrapper to implement method.
123 * @param category that logging matter occured
124 * @param log message id
126 * @param current file
127 * @param current line
130 void l7vs::Logger::putLogInfo(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)
132 LoggerImpl::getInstance().putLogInfo(cat, message_id, message, file, line);
137 * this is only wrapper to implement method.
138 * @param category that logging matter occured
139 * @param log message id
141 * @param current file
142 * @param current line
145 void l7vs::Logger::putLogDebug(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)
147 LoggerImpl::getInstance().putLogDebug(cat, message_id, message, file, line);
151 * return start category by using module.
152 * this is only wrapper to implement method.
154 * @retrun start category
156 LOG_CATEGORY_TAG l7vs::Logger::getCategoryRangeStart(LOG_MODULE_TAG mod)
158 return LoggerImpl::getInstance().getCategoryRangeStart(mod);
162 * return end category by using module.
163 * this is only wrapper to implement method.
165 * @retrun end category
167 LOG_CATEGORY_TAG l7vs::Logger::getCategoryRangeEnd(LOG_MODULE_TAG mod)
169 return LoggerImpl::getInstance().getCategoryRangeEnd(mod);
173 * reload configuration.
174 * this is only wrapper to implement method.
178 void l7vs::Logger::loadConf()
180 LoggerImpl::getInstance().loadConf();