23 #ifndef __PLUGINS_MONGODB_MONGODB_LOGGER_THREAD_H_ 24 #define __PLUGINS_MONGODB_MONGODB_LOGGER_THREAD_H_ 26 #include <core/threading/thread.h> 27 #include <aspect/logging.h> 28 #include <aspect/logger.h> 29 #include <aspect/configurable.h> 30 #include <aspect/clock.h> 31 #include <plugins/mongodb/aspect/mongodb.h> 56 virtual void log_debug(
const char *component,
const char *format, ...);
57 virtual void log_info(
const char *component,
const char *format, ...);
58 virtual void log_warn(
const char *component,
const char *format, ...);
59 virtual void log_error(
const char *component,
const char *format, ...);
61 virtual void vlog_debug(
const char *component,
const char *format, va_list va);
62 virtual void vlog_info(
const char *component,
const char *format, va_list va);
63 virtual void vlog_warn(
const char *component,
const char *format, va_list va);
64 virtual void vlog_error(
const char *component,
const char *format, va_list va);
71 virtual void tlog_debug(
struct timeval *t,
const char *component,
72 const char *format, ...);
73 virtual void tlog_info(
struct timeval *t,
const char *component,
74 const char *format, ...);
75 virtual void tlog_warn(
struct timeval *t,
const char *component,
76 const char *format, ...);
77 virtual void tlog_error(
struct timeval *t,
const char *component,
78 const char *format, ...);
80 virtual void tlog_debug(
struct timeval *t,
const char *component,
82 virtual void tlog_info(
struct timeval *t,
const char *component,
84 virtual void tlog_warn(
struct timeval *t,
const char *component,
86 virtual void tlog_error(
struct timeval *t,
const char *component,
89 virtual void vtlog_debug(
struct timeval *t,
const char *component,
90 const char *format, va_list va);
91 virtual void vtlog_info(
struct timeval *t,
const char *component,
92 const char *format, va_list va);
93 virtual void vtlog_warn(
struct timeval *t,
const char *component,
94 const char *format, va_list va);
95 virtual void vtlog_error(
struct timeval *t,
const char *component,
96 const char *format, va_list va);
99 protected:
virtual void run() { Thread::run(); }
102 void insert_message(
LogLevel ll,
const char *component,
const char *format,
105 void tlog_insert_message(
LogLevel ll,
struct timeval *t,
const char *component,
106 const char *format, va_list va);
107 void tlog_insert_message(
LogLevel ll,
struct timeval *t,
const char *component,
111 std::string __collection;
virtual void vtlog_error(struct timeval *t, const char *component, const char *format, va_list va)
Log error message for specific time.
Thread aspect that allows to provide a logger to Fawkes.
virtual void tlog_warn(struct timeval *t, const char *component, const char *format,...)
Log warning message for specific time.
Thread aspect that allows to obtain the current time from the clock.
virtual void finalize()
Finalize the thread.
virtual void vlog_info(const char *component, const char *format, va_list va)
Log informational message.
MongoLogLoggerThread()
Constructor.
Thread that provides a logger writing to MongoDB.
Fawkes library namespace.
virtual void run()
Stub to see name in backtrace for easier debugging.
Thread class encapsulation of pthreads.
virtual void log_debug(const char *component, const char *format,...)
Log debug message.
virtual void log_error(const char *component, const char *format,...)
Log error message.
virtual void tlog_error(struct timeval *t, const char *component, const char *format,...)
Log error message for specific time.
virtual void vtlog_info(struct timeval *t, const char *component, const char *format, va_list va)
Log informational message for specific time.
Base class for exceptions in Fawkes.
virtual ~MongoLogLoggerThread()
Destructor.
Thread aspect to access MongoDB.
virtual void log_warn(const char *component, const char *format,...)
Log warning message.
virtual void log_info(const char *component, const char *format,...)
Log informational message.
virtual void loop()
Code to execute in the thread.
Thread aspect to log output.
virtual void vtlog_debug(struct timeval *t, const char *component, const char *format, va_list va)
Log debug message for specific time.
Thread aspect to access configuration data.
virtual void vlog_error(const char *component, const char *format, va_list va)
Log error message.
virtual void vtlog_warn(struct timeval *t, const char *component, const char *format, va_list va)
Log warning message for specific time.
virtual void init()
Initialize the thread.
virtual void vlog_warn(const char *component, const char *format, va_list va)
Log warning message.
Mutex mutual exclusion lock.
virtual void tlog_info(struct timeval *t, const char *component, const char *format,...)
Log informational message for specific time.
virtual void vlog_debug(const char *component, const char *format, va_list va)
Log debug message.
virtual void tlog_debug(struct timeval *t, const char *component, const char *format,...)
Log debug message for specific time.