component.h

00001 
00002 /***************************************************************************
00003  *  component.h - Component logger
00004  *
00005  *  Created: Wed Mar 12 23:45:32 2008
00006  *  Copyright  2006-2008  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_COMPONENT_H_
00025 #define __UTILS_LOGGING_COMPONENT_H_
00026 
00027 #include <core/exception.h>
00028 #include <string>
00029 
00030 namespace fawkes {
00031 
00032 
00033 class Logger;
00034 
00035 class ComponentLogger
00036 {
00037  public:
00038   ComponentLogger(Logger *logger, const char *component);
00039   ~ComponentLogger();
00040 
00041   void log_debug(const char *format, ...); 
00042   void log_info(const char *format, ...);
00043   void log_warn(const char *format, ...);
00044   void log_error(const char *format, ...);
00045 
00046   void log_debug(std::string message); 
00047   void log_info(std::string message);
00048   void log_warn(std::string message);
00049   void log_error(std::string message);
00050 
00051   void log_debug(Exception &e);
00052   void log_info(Exception &e);
00053   void log_warn(Exception &e);
00054   void log_error(Exception &e);
00055 
00056  private:
00057   Logger *__logger;
00058   char *__component;
00059 };
00060 
00061 
00062 } // end namespace fawkes
00063 
00064 #endif
00065 

Generated on Tue Feb 22 13:32:28 2011 for Fawkes API by  doxygen 1.4.7