00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __UTILS_LOGGING_CONSOLE_H_
00025 #define __UTILS_LOGGING_CONSOLE_H_
00026
00027 #include <utils/logging/logger.h>
00028 #include <ctime>
00029
00030 namespace fawkes {
00031
00032
00033 class Mutex;
00034
00035 class ConsoleLogger : public Logger
00036 {
00037 public:
00038 ConsoleLogger(LogLevel log_level = LL_DEBUG);
00039 virtual ~ConsoleLogger();
00040
00041 virtual void log_debug(const char *component, const char *format, ...);
00042 virtual void log_info(const char *component, const char *format, ...);
00043 virtual void log_warn(const char *component, const char *format, ...);
00044 virtual void log_error(const char *component, const char *format, ...);
00045
00046 virtual void vlog_debug(const char *component, const char *format, va_list va);
00047 virtual void vlog_info(const char *component, const char *format, va_list va);
00048 virtual void vlog_warn(const char *component, const char *format, va_list va);
00049 virtual void vlog_error(const char *component, const char *format, va_list va);
00050
00051 virtual void log_debug(const char *component, Exception &e);
00052 virtual void log_info(const char *component, Exception &e);
00053 virtual void log_warn(const char *component, Exception &e);
00054 virtual void log_error(const char *component, Exception &e);
00055
00056 virtual void tlog_debug(struct timeval *t, const char *component, const char *format, ...);
00057 virtual void tlog_info(struct timeval *t, const char *component, const char *format, ...);
00058 virtual void tlog_warn(struct timeval *t, const char *component, const char *format, ...);
00059 virtual void tlog_error(struct timeval *t, const char *component, const char *format, ...);
00060
00061 virtual void tlog_debug(struct timeval *t, const char *component, Exception &e);
00062 virtual void tlog_info(struct timeval *t, const char *component, Exception &e);
00063 virtual void tlog_warn(struct timeval *t, const char *component, Exception &e);
00064 virtual void tlog_error(struct timeval *t, const char *component, Exception &e);
00065
00066 virtual void vtlog_debug(struct timeval *t, const char *component,
00067 const char *format, va_list va);
00068 virtual void vtlog_info(struct timeval *t, const char *component,
00069 const char *format, va_list va);
00070 virtual void vtlog_warn(struct timeval *t, const char *component,
00071 const char *format, va_list va);
00072 virtual void vtlog_error(struct timeval *t, const char *component,
00073 const char *format, va_list va);
00074
00075
00076 private:
00077 struct ::tm *now_s;
00078 Mutex *mutex;
00079 };
00080
00081
00082 }
00083
00084 #endif