Fawkes API  Fawkes Development Version
log.h
1 
2 /***************************************************************************
3  * log.h - XML-RPC methods related to logging
4  *
5  * Created: Mon Aug 31 20:35:32 2009
6  * Copyright 2006-2009 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef __PLUGINS_XMLRPC_METHODS_LOG_H_
24 #define __PLUGINS_XMLRPC_METHODS_LOG_H_
25 
26 #include <xmlrpc-c/registry.hpp>
27 
28 #include <logging/logger.h>
29 
30 namespace fawkes {
31  class CacheLogger;
32 }
33 
35  public:
36  XmlRpcLogMethods(xmlrpc_c::registry *registry,
37  fawkes::CacheLogger *cache_logger,
38  fawkes::Logger *logger);
40 
41  class log_entries : public xmlrpc_c::method {
42  public:
44  virtual ~log_entries();
45  virtual void execute(xmlrpc_c::paramList const& params,
46  xmlrpc_c::value * const result);
47  private:
48  fawkes::CacheLogger *__cache_logger;;
49  };
50 
51  class log_get_size : public xmlrpc_c::method {
52  public:
54  virtual ~log_get_size();
55  virtual void execute(xmlrpc_c::paramList const& params,
56  xmlrpc_c::value * const result);
57  private:
58  fawkes::CacheLogger *__cache_logger;;
59  };
60 
61  class log_set_size : public xmlrpc_c::method {
62  public:
63  log_set_size(fawkes::CacheLogger *cache_logger);
64  virtual ~log_set_size();
65  virtual void execute(xmlrpc_c::paramList const& params,
66  xmlrpc_c::value * const result);
67  private:
68  fawkes::CacheLogger *__cache_logger;;
69  };
70 
71  class log_log : public xmlrpc_c::method {
72  public:
74  virtual ~log_log();
75  virtual void execute(xmlrpc_c::paramList const& params,
76  xmlrpc_c::value * const result);
77  private:
78  fawkes::Logger *__logger;
79  fawkes::Logger::LogLevel __log_level;
80  };
81 
82  private:
83  xmlrpc_c::registry *__xmlrpc_registry;
84 
85  fawkes::Logger *__logger;
86  fawkes::CacheLogger *__cache_logger;
87  log_entries *__log_entries;
88  log_get_size *__log_get_size;
89  log_set_size *__log_set_size;
90  log_log *__log_log_debug;
91  log_log *__log_log_info;
92  log_log *__log_log_warn;
93  log_log *__log_log_error;
94 };
95 
96 #endif
LogLevel
Log level.
Definition: logger.h:45
Fawkes library namespace.
Wrapper class for logging related XML-RPC methods.
Definition: log.h:34
Logging Cache.
Definition: cache.h:40
Get most recent log entries via XML-RPC method.
Definition: log.h:41
XML-RPC method to get the current cache log size.
Definition: log.h:51
XML-RPC method to set maximum size of cache logger.
Definition: log.h:61
XML-RPC method to log a message.
Definition: log.h:71
Interface for logging.
Definition: logger.h:34