diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2011-11-29 04:52:52 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-05 17:17:50 +0100 |
commit | 53bd23d0e679746b78d0bcf9234e7b99983e6071 (patch) | |
tree | 51dd89aba98e57c026046fdfbe25ba72aab974a6 /src/menu/application.cpp | |
parent | a9c3f18ebc1dbb1de5c7c9d1585347ed25cc2b52 (diff) | |
download | usdx-53bd23d0e679746b78d0bcf9234e7b99983e6071.tar.gz usdx-53bd23d0e679746b78d0bcf9234e7b99983e6071.tar.xz usdx-53bd23d0e679746b78d0bcf9234e7b99983e6071.zip |
ported from log4cxx to log4cpp
log4cxx depends on Apache Portable Runtime Utility Library, so we
switch to log4cpp with nearly the same features but with no
dependencies for easier porting to other platforms
Diffstat (limited to '')
-rw-r--r-- | src/menu/application.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/menu/application.cpp b/src/menu/application.cpp index 37e532a2..d34b8003 100644 --- a/src/menu/application.cpp +++ b/src/menu/application.cpp @@ -30,11 +30,12 @@ #include "software_mouse_pointer.hpp" #include "loading_frame.hpp" #include <GL/gl.h> +#include <log4cpp/PropertyConfigurator.hh> namespace usdx { - log4cxx::LoggerPtr Application::log = - log4cxx::Logger::getLogger("usdx.menu.application"); + log4cpp::Category& Application::log = + log4cpp::Category::getInstance("usdx.menu.application"); Application* Application::instance = NULL; @@ -43,6 +44,7 @@ namespace usdx fps_manager(NULL), running(false), display_width(800), display_height(600), frames_per_second(50) { + log4cpp::PropertyConfigurator::configure("log4cpp.property"); SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO); } @@ -119,7 +121,7 @@ namespace usdx repaint(); SDL_GL_SwapBuffers(); - LOG4CXX_TRACE(log, "repaint"); + log << log4cpp::Priority::DEBUG << "repaint"; // poll current events while (event_manager.available() && SDL_PollEvent(&event)) { @@ -185,8 +187,8 @@ namespace usdx } if (! display) { - LOG4CXX_ERROR(log, "SDL_SetVideoMode failed."); - throw new std::exception(); + log << log4cpp::Priority::ERROR << "SDL_SetVideoMode failed."; + throw new std::exception(); } init_fps_manager(); |