Fawkes API  Fawkes Development Version
multi.h
1 
2 /***************************************************************************
3  * multi.h - Fawkes multi logger
4  *
5  * Created: Mon May 07 16:42:23 2007
6  * Copyright 2006-2007 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. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef _UTILS_LOGGING_MULTI_H_
25 #define _UTILS_LOGGING_MULTI_H_
26 
27 #include <logging/logger.h>
28 #include <logging/logger_employer.h>
29 
30 namespace fawkes {
31 
32 class MultiLoggerData;
33 
34 class MultiLogger : public Logger, public LoggerEmployer
35 {
36 public:
37  MultiLogger();
38  MultiLogger(Logger *logger);
39  virtual ~MultiLogger();
40 
41  void add_logger(Logger *logger);
42  void remove_logger(Logger *logger);
43 
44  virtual void set_loglevel(LogLevel level);
45 
46  virtual void log(LogLevel level, const char *component, const char *format, ...);
47  virtual void log_debug(const char *component, const char *format, ...);
48  virtual void log_info(const char *component, const char *format, ...);
49  virtual void log_warn(const char *component, const char *format, ...);
50  virtual void log_error(const char *component, const char *format, ...);
51 
52  virtual void log(LogLevel level, const char *component, Exception &e);
53  virtual void log_debug(const char *component, Exception &e);
54  virtual void log_info(const char *component, Exception &e);
55  virtual void log_warn(const char *component, Exception &e);
56  virtual void log_error(const char *component, Exception &e);
57 
58  virtual void vlog(LogLevel level, const char *component, const char *format, va_list va);
59  virtual void vlog_debug(const char *component, const char *format, va_list va);
60  virtual void vlog_info(const char *component, const char *format, va_list va);
61  virtual void vlog_warn(const char *component, const char *format, va_list va);
62  virtual void vlog_error(const char *component, const char *format, va_list va);
63 
64  virtual void
65  tlog(LogLevel level, struct timeval *t, const char *component, const char *format, ...);
66  virtual void tlog_debug(struct timeval *t, const char *component, const char *format, ...);
67  virtual void tlog_info(struct timeval *t, const char *component, const char *format, ...);
68  virtual void tlog_warn(struct timeval *t, const char *component, const char *format, ...);
69  virtual void tlog_error(struct timeval *t, const char *component, const char *format, ...);
70 
71  virtual void tlog(LogLevel level, struct timeval *t, const char *component, Exception &e);
72  virtual void tlog_debug(struct timeval *t, const char *component, Exception &e);
73  virtual void tlog_info(struct timeval *t, const char *component, Exception &e);
74  virtual void tlog_warn(struct timeval *t, const char *component, Exception &e);
75  virtual void tlog_error(struct timeval *t, const char *component, Exception &e);
76 
77  virtual void
78  vtlog(LogLevel level, struct timeval *t, const char *component, const char *format, va_list va);
79  virtual void
80  vtlog_debug(struct timeval *t, const char *component, const char *format, va_list va);
81  virtual void vtlog_info(struct timeval *t, const char *component, const char *format, va_list va);
82  virtual void vtlog_warn(struct timeval *t, const char *component, const char *format, va_list va);
83  virtual void
84  vtlog_error(struct timeval *t, const char *component, const char *format, va_list va);
85 
86 private:
87  MultiLoggerData *data;
88 };
89 
90 } // end namespace fawkes
91 
92 #endif
fawkes::MultiLogger::vtlog_debug
virtual void vtlog_debug(struct timeval *t, const char *component, const char *format, va_list va)
Definition: multi.cpp:601
fawkes::MultiLogger::log_error
virtual void log_error(const char *component, const char *format,...)
Definition: multi.cpp:241
fawkes::MultiLogger::vlog_info
virtual void vlog_info(const char *component, const char *format, va_list va)
Definition: multi.cpp:374
fawkes::MultiLogger::vlog
virtual void vlog(LogLevel level, const char *component, const char *format, va_list va)
Log message for given log level.
Definition: multi.cpp:338
fawkes::MultiLogger::vtlog_info
virtual void vtlog_info(struct timeval *t, const char *component, const char *format, va_list va)
Definition: multi.cpp:617
fawkes::MultiLogger::add_logger
void add_logger(Logger *logger)
Add a logger.
Definition: multi.cpp:114
fawkes::MultiLogger::remove_logger
void remove_logger(Logger *logger)
Remove logger.
Definition: multi.cpp:132
fawkes::MultiLogger::tlog_warn
virtual void tlog_warn(struct timeval *t, const char *component, const char *format,...)
Definition: multi.cpp:483
fawkes::MultiLogger::vlog_error
virtual void vlog_error(const char *component, const char *format, va_list va)
Definition: multi.cpp:410
fawkes::MultiLogger::log_debug
virtual void log_debug(const char *component, const char *format,...)
Definition: multi.cpp:178
fawkes::MultiLogger::log_warn
virtual void log_warn(const char *component, const char *format,...)
Definition: multi.cpp:220
fawkes::MultiLogger::tlog_info
virtual void tlog_info(struct timeval *t, const char *component, const char *format,...)
Definition: multi.cpp:464
fawkes::MultiLogger::MultiLogger
MultiLogger()
Constructor.
Definition: multi.cpp:81
fawkes::MultiLogger::log
virtual void log(LogLevel level, const char *component, const char *format,...)
Log message of given log level.
Definition: multi.cpp:157
fawkes::MultiLogger::tlog
virtual void tlog(LogLevel level, struct timeval *t, const char *component, const char *format,...)
Log message of given log level and time.
Definition: multi.cpp:428
fawkes::Logger
Definition: logger.h:40
fawkes::MultiLogger::set_loglevel
virtual void set_loglevel(LogLevel level)
Sets the log level.
Definition: multi.cpp:143
fawkes
fawkes::MultiLogger::~MultiLogger
virtual ~MultiLogger()
Destructor.
Definition: multi.cpp:99
fawkes::MultiLogger::vtlog_error
virtual void vtlog_error(struct timeval *t, const char *component, const char *format, va_list va)
Definition: multi.cpp:649
fawkes::MultiLogger::vlog_warn
virtual void vlog_warn(const char *component, const char *format, va_list va)
Definition: multi.cpp:392
fawkes::MultiLogger::vlog_debug
virtual void vlog_debug(const char *component, const char *format, va_list va)
Definition: multi.cpp:356
fawkes::MultiLogger::tlog_debug
virtual void tlog_debug(struct timeval *t, const char *component, const char *format,...)
Definition: multi.cpp:446
fawkes::Logger::LogLevel
LogLevel
Log level.
Definition: logger.h:50
fawkes::MultiLogger::vtlog
virtual void vtlog(LogLevel level, struct timeval *t, const char *component, const char *format, va_list va)
Log message for given log level and time.
Definition: multi.cpp:581
fawkes::MultiLogger::tlog_error
virtual void tlog_error(struct timeval *t, const char *component, const char *format,...)
Definition: multi.cpp:502
fawkes::MultiLogger::vtlog_warn
virtual void vtlog_warn(struct timeval *t, const char *component, const char *format, va_list va)
Definition: multi.cpp:633
fawkes::MultiLogger::log_info
virtual void log_info(const char *component, const char *format,...)
Definition: multi.cpp:199
fawkes::Exception
Definition: exception.h:39