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 <logging/logger.h>
27
28#include <xmlrpc-c/registry.hpp>
29
30namespace fawkes {
31class CacheLogger;
32}
33
35{
36public:
37 XmlRpcLogMethods(std::shared_ptr<xmlrpc_c::registry> registry,
38 fawkes::CacheLogger * cache_logger,
39 fawkes::Logger * logger);
41
42 class log_entries : public xmlrpc_c::method
43 {
44 public:
46 virtual ~log_entries();
47 virtual void execute(xmlrpc_c::paramList const &params, xmlrpc_c::value *const result);
48
49 private:
50 fawkes::CacheLogger *cache_logger_;
51 ;
52 };
53
54 class log_get_size : public xmlrpc_c::method
55 {
56 public:
58 virtual ~log_get_size();
59 virtual void execute(xmlrpc_c::paramList const &params, xmlrpc_c::value *const result);
60
61 private:
62 fawkes::CacheLogger *cache_logger_;
63 ;
64 };
65
66 class log_set_size : public xmlrpc_c::method
67 {
68 public:
69 log_set_size(fawkes::CacheLogger *cache_logger);
70 virtual ~log_set_size();
71 virtual void execute(xmlrpc_c::paramList const &params, xmlrpc_c::value *const result);
72
73 private:
74 fawkes::CacheLogger *cache_logger_;
75 ;
76 };
77
78 class log_log : public xmlrpc_c::method
79 {
80 public:
82 virtual ~log_log();
83 virtual void execute(xmlrpc_c::paramList const &params, xmlrpc_c::value *const result);
84
85 private:
86 fawkes::Logger * logger_;
87 fawkes::Logger::LogLevel log_level_;
88 };
89
90private:
91 std::shared_ptr<xmlrpc_c::registry> xmlrpc_registry_;
92
93 fawkes::Logger * logger_;
94 fawkes::CacheLogger * cache_logger_;
95 std::unique_ptr<log_entries> log_entries_;
96 std::unique_ptr<log_get_size> log_get_size_;
97 std::unique_ptr<log_set_size> log_set_size_;
98 std::unique_ptr<log_log> log_log_debug_;
99 std::unique_ptr<log_log> log_log_info_;
100 std::unique_ptr<log_log> log_log_warn_;
101 std::unique_ptr<log_log> log_log_error_;
102};
103
104#endif
Get most recent log entries via XML-RPC method.
Definition: log.h:43
log_entries(fawkes::CacheLogger *logger)
Constructor.
Definition: log.cpp:75
virtual void execute(xmlrpc_c::paramList const &params, xmlrpc_c::value *const result)
Execute method.
Definition: log.cpp:94
virtual ~log_entries()
Virtual empty destructor.
Definition: log.cpp:85
XML-RPC method to get the current cache log size.
Definition: log.h:55
virtual void execute(xmlrpc_c::paramList const &params, xmlrpc_c::value *const result)
Execute method.
Definition: log.cpp:142
log_get_size(fawkes::CacheLogger *logger)
Constructor.
Definition: log.cpp:124
virtual ~log_get_size()
Virtual empty destructor.
Definition: log.cpp:133
XML-RPC method to log a message.
Definition: log.h:79
virtual void execute(xmlrpc_c::paramList const &params, xmlrpc_c::value *const result)
Execute method.
Definition: log.cpp:214
log_log(fawkes::Logger *logger, fawkes::Logger::LogLevel log_level)
Constructor.
Definition: log.cpp:195
virtual ~log_log()
Virtual empty destructor.
Definition: log.cpp:205
XML-RPC method to set maximum size of cache logger.
Definition: log.h:67
virtual void execute(xmlrpc_c::paramList const &params, xmlrpc_c::value *const result)
Execute method.
Definition: log.cpp:174
log_set_size(fawkes::CacheLogger *cache_logger)
Constructor.
Definition: log.cpp:156
virtual ~log_set_size()
Virtual empty destructor.
Definition: log.cpp:165
Wrapper class for logging related XML-RPC methods.
Definition: log.h:35
XmlRpcLogMethods(std::shared_ptr< xmlrpc_c::registry > registry, fawkes::CacheLogger *cache_logger, fawkes::Logger *logger)
Constructor.
Definition: log.cpp:41
~XmlRpcLogMethods()
Destructor.
Definition: log.cpp:63
Logging Cache.
Definition: cache.h:38
Interface for logging.
Definition: logger.h:42
LogLevel
Log level.
Definition: logger.h:51
Fawkes library namespace.