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 **********************************************************************/
29 #include <logger_enum.h>
31 #define BUF_LEN (4096)
32 #define DEBUG_STR_LEN (4096)
33 #define ADDR_STR_LEN (16)
38 * Logger creation class.
39 * this class create Logger Inmlement class and mediate function.
44 //! default constructor creates implement class.
49 * returns single instance.
54 static Logger& getInstance() {
57 //! load Configuration.
59 //! retrieve category's log level.
60 LOG_LEVEL_TAG getLogLevel(LOG_CATEGORY_TAG cat);
61 //! set category's log level.
62 bool setLogLevel(LOG_CATEGORY_TAG cat, LOG_LEVEL_TAG level);
64 void putLogFatal(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line);
66 void putLogError(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line);
68 void putLogWarn(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line);
70 void putLogInfo(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line);
72 void putLogDebug(LOG_CATEGORY_TAG cat, const unsigned int message_id, const std::string& message, const char *file, int line);
73 //! return start category by using module.
74 LOG_CATEGORY_TAG getCategoryRangeStart(LOG_MODULE_TAG mod);
75 //! return end category by using module.
76 LOG_CATEGORY_TAG getCategoryRangeEnd(LOG_MODULE_TAG mod);
80 * static instance initialize before main.
81 * instance will defined in main program.
83 static Logger instance;