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>
29 * default constructor.
30 * get instance of implement class, and initialize
34 l7vs::Logger::Logger()
36 if (!LoggerImpl::getInstance().init()) {
46 l7vs::Logger::~Logger()
51 * retrieve category's log level.
52 * this is only wrapper to implement method.
53 * @param category that want to know
56 LOG_LEVEL_TAG l7vs::Logger::getLogLevel(LOG_CATEGORY_TAG cat)
58 return LoggerImpl::getInstance().getLogLevel(cat);
62 * set category's log level.
63 * this is only wrapper to implement method.
64 * @param category to set log level
66 * @retval true succeed
67 * @retval false failed
69 bool l7vs::Logger::setLogLevel(LOG_CATEGORY_TAG cat, LOG_LEVEL_TAG level)
71 return LoggerImpl::getInstance().setLogLevel(cat, level);
76 * this is only wrapper to implement method.
77 * @param category that logging matter occured
78 * @param log message id
84 void l7vs::Logger::putLogFatal(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)
86 LoggerImpl::getInstance().putLogFatal(cat, message_id, message, file, line);
91 * this is only wrapper to implement method.
92 * @param category that logging matter occured
93 * @param log message id
99 void l7vs::Logger::putLogError(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)
101 LoggerImpl::getInstance().putLogError(cat, message_id, message, file, line);
106 * this is only wrapper to implement method.
107 * @param category that logging matter occured
108 * @param log message id
110 * @param current file
111 * @param current line
114 void l7vs::Logger::putLogWarn(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)
116 LoggerImpl::getInstance().putLogWarn(cat, message_id, message, file, line);
121 * this is only wrapper to implement method.
122 * @param category that logging matter occured
123 * @param log message id
125 * @param current file
126 * @param current line
129 void l7vs::Logger::putLogInfo(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)
131 LoggerImpl::getInstance().putLogInfo(cat, message_id, message, file, line);
136 * this is only wrapper to implement method.
137 * @param category that logging matter occured
138 * @param log message id
140 * @param current file
141 * @param current line
144 void l7vs::Logger::putLogDebug(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line)
146 LoggerImpl::getInstance().putLogDebug(cat, message_id, message, file, line);
150 * return start category by using module.
151 * this is only wrapper to implement method.
153 * @retrun start category
155 LOG_CATEGORY_TAG l7vs::Logger::getCategoryRangeStart(LOG_MODULE_TAG mod)
157 return LoggerImpl::getInstance().getCategoryRangeStart(mod);
161 * return end category by using module.
162 * this is only wrapper to implement method.
164 * @retrun end category
166 LOG_CATEGORY_TAG l7vs::Logger::getCategoryRangeEnd(LOG_MODULE_TAG mod)
168 return LoggerImpl::getInstance().getCategoryRangeEnd(mod);
172 * reload configuration.
173 * this is only wrapper to implement method.
177 void l7vs::Logger::loadConf()
179 LoggerImpl::getInstance().loadConf();