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>
32 //! @brief Logger creation class.
33 //! @brief this class create Logger Inmlement class and mediate function.
36 const LOG_CATEGORY_TAG scopedLogCategory;
37 const unsigned int scopedLogId;
38 const std::string scopedLogMessage;
39 const char* scopedLogFile;
40 const int scopedLogLine;
43 //! default constructor creates implement class.
46 //! log output constractor
47 //! scoped log output( Logger destractor output log)
48 //! @param[in] Log output category tag
50 //! @param[in] log message
51 //! @param[in] filename (=__FILE__)
52 //! @param[in] lineno (=__LINE__)
53 Logger( LOG_CATEGORY_TAG, const unsigned int, const std::string&, const char*, int);
55 //! destructor.(output log then use log output constractor)
58 //! load Configuration.
61 //! retrieve category's log level.
62 //! @param[in] logcategory
64 static LOG_LEVEL_TAG getLogLevel( LOG_CATEGORY_TAG );
66 //! retrieve all category's log level.
67 //! @param[in] logcategory
69 static void getLogLevelAll( category_level_list_type& );
71 //! set category's log level.
72 //! @param[in] logcategory
73 //! @param[in] loglevel
74 //! @return true success loglevel change
75 //! @return false failer loglevel change
76 static bool setLogLevel(LOG_CATEGORY_TAG cat, LOG_LEVEL_TAG level);
78 //! set all category's log level.
79 //! @param[in] logcategory
80 //! @param[in] loglevel
81 //! @return true success loglevel change
82 //! @return false failer loglevel change
83 static bool setLogLevelAll( LOG_LEVEL_TAG level );
86 //! @param[in] Log output category tag
88 //! @param[in] log message
89 //! @param[in] filename (=__FILE__)
90 //! @param[in] lineno (=__LINE__)
91 static void putLogFatal( LOG_CATEGORY_TAG, const unsigned int, const std::string&, const char*, int );
94 //! @param[in] Log output category tag
96 //! @param[in] log message
97 //! @param[in] filename (=__FILE__)
98 //! @param[in] lineno (=__LINE__)
99 static void putLogError(LOG_CATEGORY_TAG, const unsigned int, const std::string&, const char*, int );
102 //! @param[in] Log output category tag
103 //! @param[in] log id
104 //! @param[in] log message
105 //! @param[in] filename (=__FILE__)
106 //! @param[in] lineno (=__LINE__)
107 static void putLogWarn(LOG_CATEGORY_TAG, const unsigned int, const std::string&, const char*, int );
110 //! @param[in] Log output category tag
111 //! @param[in] log id
112 //! @param[in] log message
113 //! @param[in] filename (=__FILE__)
114 //! @param[in] lineno (=__LINE__)
115 static void putLogInfo(LOG_CATEGORY_TAG, const unsigned int, const std::string&, const char*, int );
117 //! output debug log.
118 //! @param[in] Log output category tag
119 //! @param[in] log id
120 //! @param[in] log message
121 //! @param[in] filename (=__FILE__)
122 //! @param[in] lineno (=__LINE__)
123 static void putLogDebug(LOG_CATEGORY_TAG, const unsigned int, const std::string&, const char*, int );
125 //! set snmp sendtrap function
126 //! @param snmp send trap function object
128 static void setSnmpSendtrap( const snmpSendtrapFuncType func );