2 * @brief logger module creation class.
4 * L7VSD: Linux Virtual Server for Layer7 Load Balancing
5 * Copyright (C) 2009 NTT COMWARE Corporation.
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22 **********************************************************************/
28 #include <logger_enum.h>
33 //! @brief Logger creation class.
34 //! @brief this class create Logger Inmlement class and mediate function.
38 const LOG_CATEGORY_TAG scopedLogCategory;
39 const unsigned int scopedLogId;
40 const std::string scopedLogMessage;
41 const char *scopedLogFile;
42 const int scopedLogLine;
45 //! default constructor creates implement class.
48 //! log output constractor
49 //! scoped log output( Logger destractor output log)
50 //! @param[in] Log output category tag
52 //! @param[in] log message
53 //! @param[in] filename (=__FILE__)
54 //! @param[in] lineno (=__LINE__)
55 Logger(LOG_CATEGORY_TAG, const unsigned int, const std::string &, const char *, int);
57 //! destructor.(output log then use log output constractor)
60 //! load Configuration.
63 //! retrieve category's log level.
64 //! @param[in] logcategory
66 static LOG_LEVEL_TAG getLogLevel(LOG_CATEGORY_TAG);
68 //! retrieve all category's log level.
69 //! @param[in] logcategory
71 static void getLogLevelAll(category_level_list_type &);
73 //! set category's log level.
74 //! @param[in] logcategory
75 //! @param[in] loglevel
76 //! @return true success loglevel change
77 //! @return false failer loglevel change
78 static bool setLogLevel(LOG_CATEGORY_TAG cat, LOG_LEVEL_TAG level);
80 //! set all category's log level.
81 //! @param[in] logcategory
82 //! @param[in] loglevel
83 //! @return true success loglevel change
84 //! @return false failer loglevel change
85 static bool setLogLevelAll(LOG_LEVEL_TAG level);
88 //! @param[in] Log output category tag
90 //! @param[in] log message
91 //! @param[in] filename (=__FILE__)
92 //! @param[in] lineno (=__LINE__)
93 static void putLogFatal(LOG_CATEGORY_TAG, const unsigned int, const std::string &, const char *, int);
96 //! @param[in] Log output category tag
98 //! @param[in] log message
99 //! @param[in] filename (=__FILE__)
100 //! @param[in] lineno (=__LINE__)
101 static void putLogError(LOG_CATEGORY_TAG, const unsigned int, const std::string &, const char *, int);
104 //! @param[in] Log output category tag
105 //! @param[in] log id
106 //! @param[in] log message
107 //! @param[in] filename (=__FILE__)
108 //! @param[in] lineno (=__LINE__)
109 static void putLogWarn(LOG_CATEGORY_TAG, const unsigned int, const std::string &, const char *, int);
112 //! @param[in] Log output category tag
113 //! @param[in] log id
114 //! @param[in] log message
115 //! @param[in] filename (=__FILE__)
116 //! @param[in] lineno (=__LINE__)
117 static void putLogInfo(LOG_CATEGORY_TAG, const unsigned int, const std::string &, const char *, int);
119 //! output debug log.
120 //! @param[in] Log output category tag
121 //! @param[in] log id
122 //! @param[in] log message
123 //! @param[in] filename (=__FILE__)
124 //! @param[in] lineno (=__LINE__)
125 static void putLogDebug(LOG_CATEGORY_TAG, const unsigned int, const std::string &, const char *, int);
127 //! set snmp sendtrap function
128 //! @param snmp send trap function object
130 static void setSnmpSendtrap(const snmpSendtrapFuncType func);