Fawkes API Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * log.h - XML-RPC methods related to logging 00004 * 00005 * Created: Mon Aug 31 20:35:32 2009 00006 * Copyright 2006-2009 Tim Niemueller [www.niemueller.de] 00007 * 00008 ****************************************************************************/ 00009 00010 /* This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU Library General Public License for more details. 00019 * 00020 * Read the full text in the LICENSE.GPL file in the doc directory. 00021 */ 00022 00023 #ifndef __PLUGINS_XMLRPC_METHODS_LOG_H_ 00024 #define __PLUGINS_XMLRPC_METHODS_LOG_H_ 00025 00026 #include <xmlrpc-c/registry.hpp> 00027 00028 #include <utils/logging/logger.h> 00029 00030 namespace fawkes { 00031 class CacheLogger; 00032 } 00033 00034 class XmlRpcLogMethods { 00035 public: 00036 XmlRpcLogMethods(xmlrpc_c::registry *registry, 00037 fawkes::CacheLogger *cache_logger, 00038 fawkes::Logger *logger); 00039 ~XmlRpcLogMethods(); 00040 00041 class log_entries : public xmlrpc_c::method { 00042 public: 00043 log_entries(fawkes::CacheLogger *logger); 00044 virtual ~log_entries(); 00045 virtual void execute(xmlrpc_c::paramList const& params, 00046 xmlrpc_c::value * const result); 00047 private: 00048 fawkes::CacheLogger *__cache_logger;; 00049 }; 00050 00051 class log_get_size : public xmlrpc_c::method { 00052 public: 00053 log_get_size(fawkes::CacheLogger *logger); 00054 virtual ~log_get_size(); 00055 virtual void execute(xmlrpc_c::paramList const& params, 00056 xmlrpc_c::value * const result); 00057 private: 00058 fawkes::CacheLogger *__cache_logger;; 00059 }; 00060 00061 class log_set_size : public xmlrpc_c::method { 00062 public: 00063 log_set_size(fawkes::CacheLogger *cache_logger); 00064 virtual ~log_set_size(); 00065 virtual void execute(xmlrpc_c::paramList const& params, 00066 xmlrpc_c::value * const result); 00067 private: 00068 fawkes::CacheLogger *__cache_logger;; 00069 }; 00070 00071 class log_log : public xmlrpc_c::method { 00072 public: 00073 log_log(fawkes::Logger *logger, fawkes::Logger::LogLevel log_level); 00074 virtual ~log_log(); 00075 virtual void execute(xmlrpc_c::paramList const& params, 00076 xmlrpc_c::value * const result); 00077 private: 00078 fawkes::Logger *__logger; 00079 fawkes::Logger::LogLevel __log_level; 00080 }; 00081 00082 private: 00083 xmlrpc_c::registry *__xmlrpc_registry; 00084 00085 fawkes::Logger *__logger; 00086 fawkes::CacheLogger *__cache_logger; 00087 log_entries *__log_entries; 00088 log_get_size *__log_get_size; 00089 log_set_size *__log_set_size; 00090 log_log *__log_log_debug; 00091 log_log *__log_log_info; 00092 log_log *__log_log_warn; 00093 log_log *__log_log_error; 00094 }; 00095 00096 #endif