diff options
author | Johannes Thorn <dante@g4t3.de> | 2008-09-17 11:23:51 +0200 |
---|---|---|
committer | Johannes Thorn <dante@g4t3.de> | 2008-09-17 11:23:51 +0200 |
commit | 88c31c67ff4ec5be12a00e41b177cea8ecd7e941 (patch) | |
tree | d7939e1fcd21047a5cb80c365e7ea2b056802cfa /src | |
parent | 039c218a7b1f2eae4f8e8305bc8e8bf70a67beab (diff) | |
download | mad-88c31c67ff4ec5be12a00e41b177cea8ecd7e941.tar mad-88c31c67ff4ec5be12a00e41b177cea8ecd7e941.zip |
(no commit message)
Diffstat (limited to 'src')
-rw-r--r-- | src/Common/Logger.cpp | 44 | ||||
-rw-r--r-- | src/Common/Logger.h | 32 | ||||
-rw-r--r-- | src/Common/Makefile.am | 7 | ||||
-rw-r--r-- | src/Common/Makefile.in | 31 |
4 files changed, 89 insertions, 25 deletions
diff --git a/src/Common/Logger.cpp b/src/Common/Logger.cpp new file mode 100644 index 0000000..6a86d23 --- /dev/null +++ b/src/Common/Logger.cpp @@ -0,0 +1,44 @@ +/* + * Logger.cpp + * + * Created on: 10.09.2008 + * Author: dante + */ + +#include "Logger.h" +#include <iostream> + +namespace Mad { +namespace Common { + +void Logger::printMessage(int typeOfMessage, std::string message) { + switch(typeOfMessage) { + case CRITICAL: + std::cout << "CRITICAL: " << message << std::endl; + break; + case ERROR: + std::cout << "ERROR: " << message << std::endl; + break; + case WARNING: + std::cout << "WARNING: " << message << std::endl; + break; + case VERBOSE: + std::cout << "MESSAGE: " << message << std::endl; + break; + case DEBUG: + std::cout << "DEBUG: " << message << std::endl; + break; + default: + std::cout << "MESSAGE: " << message << std::endl; + } +} + +Logger::Logger(int type) { + this->loggingType = type; +} +Logger::~Logger() { + // TODO Auto-generated destructor stub +} + +} +} diff --git a/src/Common/Logger.h b/src/Common/Logger.h new file mode 100644 index 0000000..cbfe4dd --- /dev/null +++ b/src/Common/Logger.h @@ -0,0 +1,32 @@ +/* + * Logger.h + * + * Created on: 10.09.2008 + * Author: dante + */ + +#ifndef MAD_COMMON_LOGGER_H_ +#define MAD_COMMON_LOGGER_H_ + +#include <string> + +namespace Mad { +namespace Common { + +class Logger { + //TODO Enum type mit unterschiedlichen Stufen + private: + int loggingType; + public: + enum messageType { + CRITICAL, ERROR, WARNING, DEFAULT, VERBOSE, DEBUG + }; + void printMessage(messageType typeOfMessage, std::string message); + Logger(int type); + virtual ~Logger(); +}; + +} +} + +#endif /* MAD_COMMON_LOGGER_H_ */ diff --git a/src/Common/Makefile.am b/src/Common/Makefile.am index 80f01ba..f04f3db 100644 --- a/src/Common/Makefile.am +++ b/src/Common/Makefile.am @@ -1,7 +1,6 @@ -SUBDIRS = Backends Requests RequestHandlers +SUBDIRS = Request noinst_LTLIBRARIES = libcommon.la -libcommon_la_SOURCES = ConfigManager.cpp Exception.cpp RequestManager.cpp SystemBackend.cpp Util.cpp -libcommon_la_LIBADD = Backends/libbackends.la Requests/librequests.la RequestHandlers/librequesthandlers.la +libcommon_la_SOURCES = ConfigManager.cpp RequestManager.cpp -noinst_HEADERS = ConfigManager.h Exception.h Request.h RequestBase.h RequestHandler.h RequestManager.h SystemBackend.h Util.h +noinst_HEADERS = ConfigManager.h RequestHandler.h RequestManager.h Util.h diff --git a/src/Common/Makefile.in b/src/Common/Makefile.in index 7c2408e..75088dc 100644 --- a/src/Common/Makefile.in +++ b/src/Common/Makefile.in @@ -44,10 +44,8 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) -libcommon_la_DEPENDENCIES = Backends/libbackends.la \ - Requests/librequests.la RequestHandlers/librequesthandlers.la -am_libcommon_la_OBJECTS = ConfigManager.lo Exception.lo \ - RequestManager.lo SystemBackend.lo Util.lo +libcommon_la_LIBADD = +am_libcommon_la_OBJECTS = ConfigManager.lo RequestManager.lo libcommon_la_OBJECTS = $(am_libcommon_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/depcomp @@ -97,15 +95,15 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ +ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -FGREP = @FGREP@ +F77 = @F77@ +FFLAGS = @FFLAGS@ GREP = @GREP@ -GSSAPI_LIBS = @GSSAPI_LIBS@ GnuTLS_CFLAGS = @GnuTLS_CFLAGS@ GnuTLS_LIBS = @GnuTLS_LIBS@ INSTALL = @INSTALL@ @@ -113,7 +111,6 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ @@ -123,7 +120,6 @@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ -NM = @NM@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ @@ -133,11 +129,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PCRECPP_CFLAGS = @PCRECPP_CFLAGS@ -PCRECPP_LIBS = @PCRECPP_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ -READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ @@ -149,7 +142,7 @@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -180,7 +173,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -197,11 +189,10 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = Backends Requests RequestHandlers +SUBDIRS = Request noinst_LTLIBRARIES = libcommon.la -libcommon_la_SOURCES = ConfigManager.cpp Exception.cpp RequestManager.cpp SystemBackend.cpp Util.cpp -libcommon_la_LIBADD = Backends/libbackends.la Requests/librequests.la RequestHandlers/librequesthandlers.la -noinst_HEADERS = ConfigManager.h Exception.h Request.h RequestBase.h RequestHandler.h RequestManager.h SystemBackend.h Util.h +libcommon_la_SOURCES = ConfigManager.cpp RequestManager.cpp Logger.cpp +noinst_HEADERS = ConfigManager.h RequestHandler.h RequestManager.h Util.h Logger.h all: all-recursive .SUFFIXES: @@ -254,10 +245,8 @@ distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ConfigManager.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Exception.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Logger.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RequestManager.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SystemBackend.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Util.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< |