liblogger.h
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_LIBLOGGER_H_
00025 #define __UTILS_LOGGING_LIBLOGGER_H_
00026
00027 #include <core/exception.h>
00028 #include <cstdarg>
00029 #include <cstddef>
00030
00031 namespace fawkes {
00032
00033
00034 class MultiLogger;
00035 class Logger;
00036 class Mutex;
00037
00038 class LibLogger
00039 {
00040 public:
00041 static void init(MultiLogger *multi_logger = NULL);
00042 static void finalize();
00043
00044 static void add_logger(Logger *logger);
00045 static void remove_logger(Logger *logger);
00046
00047 static void log_debug(const char *component, const char *format, ...);
00048 static void log_info(const char *component, const char *format, ...);
00049 static void log_warn(const char *component, const char *format, ...);
00050 static void log_error(const char *component, const char *format, ...);
00051
00052 static void vlog_debug(const char *component, const char *format, va_list va);
00053 static void vlog_info(const char *component, const char *format, va_list va);
00054 static void vlog_warn(const char *component, const char *format, va_list va);
00055 static void vlog_error(const char *component, const char *format, va_list va);
00056
00057 static void log_debug(const char *component, Exception &e);
00058 static void log_info(const char *component, Exception &e);
00059 static void log_warn(const char *component, Exception &e);
00060 static void log_error(const char *component, Exception &e);
00061
00062 private:
00063 LibLogger(){};
00064
00065 static MultiLogger *logger;
00066 static Mutex *mutex;
00067 };
00068
00069
00070 }
00071
00072 #endif