Fawkes API Fawkes Development Version

liblogger.h

00001 
00002 /***************************************************************************
00003  *  liblogger.h - Fawkes lib logger
00004  *
00005  *  Created: Mon May 07 15:19:34 2007
00006  *  Copyright  2006-2007  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
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 } // end namespace fawkes
00071 
00072 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends