/*!
 * @file  logger_enum.h
 * @brief logger module constants enumeration.
 *
 * L7VSD: Linux Virtual Server for Layer7 Load Balancing
 * Copyright (C) 2009  NTT COMWARE Corporation.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA
 *
 **********************************************************************/

#ifndef LOGGER_ENUM_H
#define LOGGER_ENUM_H

#include <list>
#include <boost/function.hpp>
#include <log4cxx/level.h>
#include "trapmessage.h"
#include "error_code.h"

namespace l7vs
{

//!    @enum    LOG_LV_TAG
//!    @brief    LogLevel enumeration.
enum LOG_LEVEL_TAG    {
        LOG_LV_NONE = 0,    //!< loglevel is none
        LOG_LV_DEBUG,        //!< loglevel is debug
        LOG_LV_INFO,        //!< loglevel is info
        LOG_LV_WARN,        //!< loglevel is warn
        LOG_LV_ERROR,        //!< loglevel is error
        LOG_LV_FATAL        //!< loglevel is fatal
};

//! loglevel enum increment function
//! @param[in]    logleveltag reference
//!    @return        logleveltag reference
inline LOG_LEVEL_TAG &operator++(LOG_LEVEL_TAG &level)
{
        level = static_cast<LOG_LEVEL_TAG>(level + 1);
        return level;
}

//!    @enum    LOG_CATEGORY_TAG
//!    @brief    Category enumeration.
enum LOG_CATEGORY_TAG {
        LOG_CAT_NONE = 0,                        //!< logcategory is none
        LOG_CAT_L7VSD_NETWORK,                    //!< logcategory is network
        LOG_CAT_L7VSD_NETWORK_QOS,                //!< logcategory is QoS
        LOG_CAT_L7VSD_NETWORK_BANDWIDTH,        //!< logcategory is bps
        LOG_CAT_L7VSD_NETWORK_NUM_CONNECTION,    //!< logcategory is connection count
        LOG_CAT_L7VSD_NETWORK_ACCESS,            //!< logcategory is access log
        LOG_CAT_L7VSD_MAINTHREAD,                //!< logcategory is mainthread
        LOG_CAT_L7VSD_VIRTUALSERVICE,            //!< logcategory is virtualservice
        LOG_CAT_L7VSD_VIRTUALSERVICE_THREAD,    //!< logcategory is virtualservice thread
        LOG_CAT_L7VSD_SESSION,                    //!< logcategory is session
        LOG_CAT_L7VSD_SESSION_THREAD,            //!< logcategory is session thread
        LOG_CAT_L7VSD_REALSERVER,                //!< logcategory is realserver
        LOG_CAT_L7VSD_SORRYSERVER,                //!< logcategory is sorryserver
        LOG_CAT_L7VSD_MODULE,                    //!< logcategory is module controller
        LOG_CAT_L7VSD_REPLICATION,                //!< logcategory is replication
        LOG_CAT_L7VSD_REPLICATION_SENDTHREAD,    //!< logcategory is replication send thread
        LOG_CAT_L7VSD_PARAMETER,                //!< logcategory is parameter
        LOG_CAT_L7VSD_LOGGER,                    //!< logcategory is logger
        LOG_CAT_L7VSD_COMMAND,                    //!< logcategory is command receiver
        LOG_CAT_L7VSD_START_STOP,                //!< logcategory is main function used
        LOG_CAT_L7VSD_SYSTEM,                    //!< logcategory is systemcall other
        LOG_CAT_L7VSD_SYSTEM_MEMORY,            //!< logcategory is systemcall memory
        LOG_CAT_L7VSD_SYSTEM_ENDPOINT,            //!< logcategory is systemcall socket
        LOG_CAT_L7VSD_SYSTEM_SIGNAL,            //!< logcategory is systemcall signal
        LOG_CAT_L7VSD_SYSTEM_ENVIRONMENT,        //!< logcategory is systemcall env
        LOG_CAT_L7VSD_SNMPAGENT,                //!< logcategory is snmp_agent

        LOG_CAT_PROTOCOL,                        //!< logcategory is protocol.
        LOG_CAT_SCHEDULE,                        //!< logcategory is schedule

        LOG_CAT_L7VSADM_PARSE,                    //!< logcategory is parse
        LOG_CAT_L7VSADM_OPERATE,                //!< logcategory is operate
        LOG_CAT_L7VSADM_CONFIG_RESULT,            //!< logcategory is configure
        LOG_CAT_L7VSADM_COMMON,                    //!< logcategory is other
        LOG_CAT_L7VSADM_LOGGER,                    //!< logcategory is logger
        LOG_CAT_L7VSADM_PARAMETER,                //!< logcategory is parameter
        LOG_CAT_L7VSADM_MODULE,                    //!< logcategory is module control

        LOG_CAT_END,                                //!< end of logcategory
};


//! logcategory enum increment function
//! @param[in]    logcategorytag reference
//!    @return        logcategorytag reference
inline LOG_CATEGORY_TAG &operator++(LOG_CATEGORY_TAG &cat)
{
        cat = static_cast<LOG_CATEGORY_TAG>(cat + 1);
        return cat;
}

//! typedef category level pair list
typedef    std::list< std::pair< LOG_CATEGORY_TAG, LOG_LEVEL_TAG > >
category_level_list_type;

} //namespace l7vs
#endif    //__LOGGER_ENUM_H__
